X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=tests%2Fui%2Fparser%2Fbad-recover-ty-after-impl.rs;fp=tests%2Fui%2Fparser%2Fbad-recover-ty-after-impl.rs;h=510e08ba091a4058f3e76fb08280e42a1c44c607;hb=ab09405e99ec2a0feab5750eed67c8a35051f5f3;hp=0000000000000000000000000000000000000000;hpb=46c7c91ce746e9edb94dad5a4d4d5fd682582c78;p=rust.git diff --git a/tests/ui/parser/bad-recover-ty-after-impl.rs b/tests/ui/parser/bad-recover-ty-after-impl.rs new file mode 100644 index 00000000000..510e08ba091 --- /dev/null +++ b/tests/ui/parser/bad-recover-ty-after-impl.rs @@ -0,0 +1,17 @@ +// check-pass + +macro_rules! impl_primitive { + ($ty:ty) => { impl_primitive!(impl $ty); }; + (impl $ty:ty) => { fn a(_: $ty) {} } +} + +impl_primitive! { u8 } + +macro_rules! test { + ($ty:ty) => { compile_error!("oh no"); }; + (impl &) => {}; +} + +test!(impl &); + +fn main() {}