summaryrefslogtreecommitdiffstats
path: root/tests/ui/hygiene/trait_items.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/hygiene/trait_items.rs')
-rw-r--r--tests/ui/hygiene/trait_items.rs21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/ui/hygiene/trait_items.rs b/tests/ui/hygiene/trait_items.rs
new file mode 100644
index 000000000..15c4acbc9
--- /dev/null
+++ b/tests/ui/hygiene/trait_items.rs
@@ -0,0 +1,21 @@
+#![feature(decl_macro)]
+
+mod foo {
+ pub trait T {
+ fn f(&self) {}
+ }
+ impl T for () {}
+}
+
+mod bar {
+ use foo::*;
+ pub macro m() { ().f() }
+ fn f() { ::baz::m!(); }
+}
+
+mod baz {
+ pub macro m() { ().f() } //~ ERROR no method named `f` found
+ fn f() { ::bar::m!(); }
+}
+
+fn main() {}