rust/tests/ui/hygiene/no_implicit_prelude.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

21 lines
363 B
Rust
Raw Normal View History

#![feature(decl_macro)]
2017-03-25 02:37:55 +00:00
mod foo {
pub macro m() { Vec::<i32>::new(); ().clone() }
2017-03-25 02:37:55 +00:00
fn f() { ::bar::m!(); }
}
#[no_implicit_prelude]
mod bar {
pub macro m() {
Vec::new(); //~ ERROR failed to resolve
().clone() //~ ERROR no method named `clone` found
}
fn f() {
::foo::m!();
assert!(true);
}
2017-03-25 02:37:55 +00:00
}
fn main() {}