resolve: Scale back hard-coded extern prelude additions
This commit is contained in:
parent
522948827b
commit
894a8d574d
2 changed files with 10 additions and 8 deletions
|
|
@ -1680,13 +1680,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(),
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error[E0432]: unresolved import `alloc`
|
|||
--> $DIR/issue-54006.rs:16:5
|
||||
|
|
||||
LL | use alloc::vec;
|
||||
| ^^^^^ Did you mean `std::alloc`?
|
||||
| ^^^^^ Did you mean `core::alloc`?
|
||||
|
||||
error: cannot determine resolution for the macro `vec`
|
||||
--> $DIR/issue-54006.rs:20:18
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue