Skip to content

resolve: Extern prelude is for type namespace only #56264

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

Merged
merged 1 commit into from
Nov 27, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/librustc_resolve/resolve_imports.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
8 changes: 8 additions & 0 deletions src/test/ui/imports/issue-56263.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// compile-pass
// edition:2018

use ::std;

fn main() {
let std = 10;
}