-
Notifications
You must be signed in to change notification settings - Fork 13.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make libsyntax compile with minimal amount of feature flags #24518
Comments
@alexcrichton: Regarding |
@alexcrichton: Interestingly enough, I just added another variation that modified pub fn map3<F>(mut self, f: F) -> P<T> where
F: FnOnce(&mut T),
{
f(&mut *self.ptr);
self
} And it's ~66% faster. So maybe I should just replace all the users with that pattern. It's unfortunately a little less convenient, but it might not be that bad if most of the users are isolated to edit: here's the benchmark. |
@erickt if we could get by with the You can also just replace the |
@alexcrichton: Regarding BitSet, it's only used in attr.rs in order to speed up tracking if an attribute has been used or not. We got three options for syntex:
What do you think is best? |
@erickt in general I'm hesitant to contort libsyntax too much, so I would optimize for the least invasive solution. I'm not sure what the stability track is for |
Why is this tagged |
Closing in favor of (newer) #41732. |
This a meta-bug that's tracking getting libsyntax to compile with the smallest possible feature flag set so that I can use it as the foundation for syntex. I've done a bunch of the work in #24487, but here are some more longer term dependencies that need some planning:
Here's what needs to be done:
#[feature(core)]
:Int::zero()
in astToPrimitive
in codemapusize::to_u32()
in codemapptr::read_and_drop()
in foldslice::ref_slice()
in parser#[feature(collections)]
:std::collections::BitSet
String::escape_default
#[feature(libc)]
:libc::c_uint
in codemap.rslibc::isatty(libc::STDERR_FILENO)
in diagnostic.rs#[feature(unicode)]
:char.width()
in diagnostic.rschar.is_xid_start()
in lexerchar.is_xid_continue()
in lexer#[feature(path_ext)]
:Path::exists()
- easily replaced with call to metadata#[feature(str_char)]
:str::char_at()
- replace withs.chars().take()
str::slice_shift_char()
#[feature(rustc_private)]
:arena
fmt_macros
term
- can use https://github.com/rust-lang/termThe text was updated successfully, but these errors were encountered: