summaryrefslogtreecommitdiffstats
path: root/tests/ui/parser/issues/issue-48137-macros-cannot-interpolate-impl-items.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/parser/issues/issue-48137-macros-cannot-interpolate-impl-items.rs')
-rw-r--r--tests/ui/parser/issues/issue-48137-macros-cannot-interpolate-impl-items.rs34
1 files changed, 34 insertions, 0 deletions
diff --git a/tests/ui/parser/issues/issue-48137-macros-cannot-interpolate-impl-items.rs b/tests/ui/parser/issues/issue-48137-macros-cannot-interpolate-impl-items.rs
new file mode 100644
index 000000000..8592f8a72
--- /dev/null
+++ b/tests/ui/parser/issues/issue-48137-macros-cannot-interpolate-impl-items.rs
@@ -0,0 +1,34 @@
+// check-pass
+
+fn main() {}
+
+macro_rules! mac_impl {
+ ($i:item) => {
+ struct S;
+ impl S { $i }
+ }
+}
+
+mac_impl! {
+ fn foo() {}
+}
+
+macro_rules! mac_trait {
+ ($i:item) => {
+ trait T { $i }
+ }
+}
+
+mac_trait! {
+ fn foo() {}
+}
+
+macro_rules! mac_extern {
+ ($i:item) => {
+ extern "C" { $i }
+ }
+}
+
+mac_extern! {
+ fn foo();
+}