Conversation
|
HIR ty lowering was modified cc @fmease |
This comment has been minimized.
This comment has been minimized.
a2f2abf to
3031b7d
Compare
This comment has been minimized.
This comment has been minimized.
3031b7d to
a4f7d4d
Compare
| && let sym = Symbol::intern(name) | ||
| && sym.can_be_raw() | ||
| { | ||
| Some((IdentKey::with_root_ctxt(sym), ExternPreludeEntry::flag())) |
There was a problem hiding this comment.
Names with :: shouldn't be added to the map here, even if they are added they will never be used anyway.
There was a problem hiding this comment.
I don't think ScopeSet::NamespacedCrate is necessary.
If only one scope is visited, then none of the ambiguity tracking infra in resolve_ident_in_scope_set is needed, you can just do the extern prelude lookup here directly.
This relates to one of your previous comments. I chose to keep these in the extern prelude, because we use them in resolve_ident_in_module. An alternative would be to keep a map like the namespaced_crate_names field. Keeping them in extern_prelude seems ok to me, given that they are passed via --extern.
| extern_prelude.insert(IdentKey::with_root_ctxt(sym::core), ExternPreludeEntry::flag()); | ||
|
|
||
| if !attr::contains_name(attrs, sym::no_std) { | ||
| extern_prelude.insert(IdentKey::with_root_ctxt(sym::std), ExternPreludeEntry::flag()); |
There was a problem hiding this comment.
Probably need a test with an open namespace called std.
I guess now explicit --extern std::something should shadow the implicit real std, but eventually in the part 2 the latter should "link" to the former as a fallback.
There was a problem hiding this comment.
Added a test, but since the real std seems to also be in the extern-prelude no OpenMod is ever created and the real std isn't shadowed.
|
Thanks for the review. @rustbot ready |
Part 1 of #152299
r? @petrochenkov