Skip to content

Commit

Permalink
resolve: Scale back hard-coded extern prelude additions
Browse files Browse the repository at this point in the history
  • Loading branch information
petrochenkov authored and pietroalbini committed Oct 18, 2018
1 parent 8b2e8dc commit dbfba9d
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/librustc_resolve/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1678,13 +1678,15 @@ impl<'a, 'crateloader: 'a> Resolver<'a, 'crateloader> {
let mut extern_prelude: FxHashSet<Name> =
session.opts.externs.iter().map(|kv| Symbol::intern(kv.0)).collect();

// HACK(eddyb) this ignore the `no_{core,std}` attributes.
// FIXME(eddyb) warn (elsewhere) if core/std is used with `no_{core,std}`.
// if !attr::contains_name(&krate.attrs, "no_core") {
// if !attr::contains_name(&krate.attrs, "no_std") {
extern_prelude.insert(Symbol::intern("core"));
extern_prelude.insert(Symbol::intern("std"));
extern_prelude.insert(Symbol::intern("meta"));
if !attr::contains_name(&krate.attrs, "no_core") {
extern_prelude.insert(Symbol::intern("core"));
if !attr::contains_name(&krate.attrs, "no_std") {
extern_prelude.insert(Symbol::intern("std"));
if session.rust_2018() {
extern_prelude.insert(Symbol::intern("meta"));
}
}
}

let mut invocations = FxHashMap();
invocations.insert(Mark::root(),
Expand Down

0 comments on commit dbfba9d

Please sign in to comment.