提交 894a8d57 编写于 作者: V Vadim Petrochenkov

resolve: Scale back hard-coded extern prelude additions

上级 52294882
......@@ -1680,13 +1680,15 @@ pub fn new(session: &'a Session,
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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册