Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-def/src/macro_expansion_tests/proc_macros.rs')
-rw-r--r--crates/hir-def/src/macro_expansion_tests/proc_macros.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/crates/hir-def/src/macro_expansion_tests/proc_macros.rs b/crates/hir-def/src/macro_expansion_tests/proc_macros.rs
index 5216246910..6f30ca04af 100644
--- a/crates/hir-def/src/macro_expansion_tests/proc_macros.rs
+++ b/crates/hir-def/src/macro_expansion_tests/proc_macros.rs
@@ -341,3 +341,22 @@ struct Foo;
#[helper_should_be_ignored] struct Foo;"#]],
);
}
+
+#[test]
+fn attribute_macro_stripping_with_cfg() {
+ check(
+ r#"
+//- proc_macros: generate_suffixed_type
+#[cfg(all())]
+#[proc_macros::generate_suffixed_type]
+struct S;
+"#,
+ expect![[r#"
+#[cfg(all())]
+#[proc_macros::generate_suffixed_type]
+struct S;
+
+struct S;
+struct SSuffix;"#]],
+ );
+}