resolve: Filter away macro prelude in modules with #[no_implicit_prelude] on 2018 edition
This commit is contained in:
parent
e53a5ffd6b
commit
9ed9d6d0d0
5 changed files with 37 additions and 5 deletions
11
src/test/ui/hygiene/no_implicit_prelude-2018.rs
Normal file
11
src/test/ui/hygiene/no_implicit_prelude-2018.rs
Normal 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() {}
|
||||
10
src/test/ui/hygiene/no_implicit_prelude-2018.stderr
Normal file
10
src/test/ui/hygiene/no_implicit_prelude-2018.stderr
Normal 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
|
||||
|
||||
|
|
@ -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() {}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue