Skip to content

Commit

Permalink
resolve: Absolute paths may be undetermined on 2018 edition
Browse files Browse the repository at this point in the history
due to macro-expanded `extern crate` items adding names to extern prelude.
  • Loading branch information
petrochenkov committed Oct 27, 2018
1 parent 171df34 commit b45b4da
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/librustc_resolve/resolve_imports.rs
Expand Up @@ -226,6 +226,9 @@ impl<'a, 'crateloader> Resolver<'a, 'crateloader> {
let module = self.get_module(binding.def().def_id());
self.populate_module_if_necessary(module);
return Ok(binding);
} else if !self.graph_root.unresolved_invocations.borrow().is_empty() {
// Macro-expanded `extern crate`items still can add names to extern prelude.
return Err(Undetermined);
} else {
return Err(Determined);
}
Expand Down
@@ -0,0 +1,18 @@
// compile-pass
// edition:2018

#![feature(extern_crate_item_prelude)]

macro_rules! define_iso { () => {
extern crate std as iso;
}}

::iso::thread_local! {
static S: u8 = 0;
}

define_iso!();

fn main() {
let s = S;
}

0 comments on commit b45b4da

Please sign in to comment.