]> git.lizzy.rs Git - rust.git/blobdiff - tests/ui/parser/bad-recover-ty-after-impl.rs
Auto merge of #107828 - compiler-errors:rollup-gyj6dgj, r=compiler-errors
[rust.git] / tests / ui / parser / bad-recover-ty-after-impl.rs
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 (file)
index 0000000..510e08b
--- /dev/null
@@ -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() {}