resolve: Filter away macro prelude in modules with #[no_implicit_prelude] on 2018 edition

This commit is contained in:
Vadim Petrochenkov 2018-11-03 00:07:56 +03:00
parent e53a5ffd6b
commit 9ed9d6d0d0
5 changed files with 37 additions and 5 deletions

View file

@ -0,0 +1,11 @@
// edition:2018
#[no_implicit_prelude]
mod bar {
fn f() {
::std::print!(""); // OK
print!(); //~ ERROR cannot find macro `print!` in this scope
}
}
fn main() {}

View file

@ -0,0 +1,10 @@
error: cannot find macro `print!` in this scope
--> $DIR/no_implicit_prelude-2018.rs:7:9
|
LL | print!(); //~ ERROR cannot find macro `print!` in this scope
| ^^^^^
|
= help: have you added the `#[macro_use]` on the module/import?
error: aborting due to previous error

View file

@ -21,7 +21,10 @@ mod bar {
Vec::new(); //~ ERROR failed to resolve
().clone() //~ ERROR no method named `clone` found
}
fn f() { ::foo::m!(); }
fn f() {
::foo::m!();
println!(); // OK on 2015 edition (at least for now)
}
}
fn main() {}