-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Remove some unnecessary symbol interner ops #61813
Remove some unnecessary symbol interner ops #61813
Conversation
|
||
fn intern(&mut self, string: &str, primitive_type: PrimTy) { | ||
self.primitive_types.insert(Symbol::intern(string), primitive_type); | ||
let mut table = FxHashMap::default(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a neat hashmap! { ... }
macro in maplit that we could perhaps use to make this less boiler-platey?
@@ -314,7 +314,7 @@ impl<'a> Resolver<'a> { | |||
Ident::new(kw::SelfLower, new_span) | |||
), | |||
kind: ast::UseTreeKind::Simple( | |||
Some(Ident::from_str_and_span("__dummy", new_span).gensym()), | |||
Some(Ident::new(kw::Underscore, new_span)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, this code is buggy (#61826), but this change shouldn't make it more buggy since the import is ty::Visibility::Invisible
.
r=me with the nit addressed |
bc65021
to
5c84cd3
Compare
@bors r=petrochenkov |
📌 Commit 5c84cd3 has been approved by |
…mbol-ops, r=petrochenkov Remove some unnecessary symbol interner ops * Don't gensym symbols that don't need to worry about colliding with other symbols * Use symbol constants instead of interning string literals in a few places. * Don't generate a module in `__register_diagnostic` r? @petrochenkov
…mbol-ops, r=petrochenkov Remove some unnecessary symbol interner ops * Don't gensym symbols that don't need to worry about colliding with other symbols * Use symbol constants instead of interning string literals in a few places. * Don't generate a module in `__register_diagnostic` r? @petrochenkov
…mbol-ops, r=petrochenkov Remove some unnecessary symbol interner ops * Don't gensym symbols that don't need to worry about colliding with other symbols * Use symbol constants instead of interning string literals in a few places. * Don't generate a module in `__register_diagnostic` r? @petrochenkov
Rollup of 6 pull requests Successful merges: - #61785 (note some safety concerns of raw-ptr-to-ref casts) - #61805 (typeck: Fix ICE for blocks in repeat expr count.) - #61813 (Remove some unnecessary symbol interner ops) - #61824 (in which we decline to lint single-use lifetimes in `derive`d impls) - #61844 (Change `...` to `..=` where applicable) - #61854 (Minor cosmetic improvements to accompany PR 61825) Failed merges: r? @ghost
__register_diagnostic
r? @petrochenkov