diff options
Diffstat (limited to 'tests/ui/traits/item-inside-macro.rs')
-rw-r--r-- | tests/ui/traits/item-inside-macro.rs | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/ui/traits/item-inside-macro.rs b/tests/ui/traits/item-inside-macro.rs new file mode 100644 index 000000000..54bf872d0 --- /dev/null +++ b/tests/ui/traits/item-inside-macro.rs @@ -0,0 +1,30 @@ +// run-pass +// Issue #34183 + +macro_rules! foo { + () => { + fn foo() { } + } +} + +macro_rules! bar { + () => { + fn bar(); + } +} + +trait Bleh { + foo!(); + bar!(); +} + +struct Test; + +impl Bleh for Test { + fn bar() {} +} + +fn main() { + Test::bar(); + Test::foo(); +} |