Auto merge of #56264 - petrochenkov:typonly, r=nikomatsakis
resolve: Extern prelude is for type namespace only Fixes https://github.com/rust-lang/rust/issues/56263 (stable-to-beta regression)
This commit is contained in:
commit
400c2bc5ed
2 changed files with 11 additions and 1 deletions
|
|
@ -173,7 +173,9 @@ impl<'a, 'crateloader> Resolver<'a, 'crateloader> {
|
|||
}
|
||||
ModuleOrUniformRoot::ExternPrelude => {
|
||||
assert!(!restricted_shadowing);
|
||||
return if let Some(binding) = self.extern_prelude_get(ident, !record_used) {
|
||||
return if ns != TypeNS {
|
||||
Err((Determined, Weak::No))
|
||||
} else if let Some(binding) = self.extern_prelude_get(ident, !record_used) {
|
||||
Ok(binding)
|
||||
} else if !self.graph_root.unresolved_invocations.borrow().is_empty() {
|
||||
// Macro-expanded `extern crate` items can add names to extern prelude.
|
||||
|
|
|
|||
8
src/test/ui/imports/issue-56263.rs
Normal file
8
src/test/ui/imports/issue-56263.rs
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
// compile-pass
|
||||
// edition:2018
|
||||
|
||||
use ::std;
|
||||
|
||||
fn main() {
|
||||
let std = 10;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue