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.
|
Thanks for the review. @rustbot ready |
|
|
||
| use my_api::root_function; | ||
| use my_api::utils::util; | ||
| //~^ ERROR E0432 |
There was a problem hiding this comment.
| //~^ ERROR E0432 | |
| //~^ ERROR unresolved import `my_api::utils` |
| @@ -0,0 +1,12 @@ | |||
| // Tests that namespaced crate names are limited to two segments | |||
There was a problem hiding this comment.
Non-relevant copypasted comment.
| /// **Belongs to the type namespace.** | ||
| ToolMod, | ||
|
|
||
| /// The resolution for a virtual module in a namespaced crate. E.g. `my_api` |
There was a problem hiding this comment.
"Virtual" is still used in a number of comments and variables.
| let open_ns_name = format!("{}::{}", sym.as_str(), ident.name); | ||
| let ns_ident = IdentKey::with_root_ctxt(Symbol::intern(&open_ns_name)); | ||
| match self.extern_prelude_get_flag(ns_ident, ident.span, finalize.is_some()) { | ||
| Some(decl) => Ok(decl), |
There was a problem hiding this comment.
No need for the concatenation above, we can lookup the ident directly and return Ok only if the returned Decl is Res::OpenMod.
| } | ||
| Err(determinacy) => Err(determinacy.into_value()), | ||
| }; | ||
|
|
There was a problem hiding this comment.
Nit: unnecessary change.
| missing_virtual_bases.into_iter().map(|ident| (ident, ExternPreludeEntry::virtual_flag())), | ||
| ); | ||
|
|
||
| debug!(?extern_prelude); |
There was a problem hiding this comment.
Nit: could you remove the added debugging logic before merging?
Part 1 of #152299
r? @petrochenkov