aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_def/src/nameres/tests/macros.rs
diff options
context:
space:
mode:
authorEdwin Cheng <[email protected]>2021-03-27 05:44:54 +0000
committerEdwin Cheng <[email protected]>2021-03-27 05:44:54 +0000
commita193666361f6ea9725b927a35f5baf77da713c0a (patch)
treefa916fcc7e5031df796f42521fb74d775ebdec59 /crates/hir_def/src/nameres/tests/macros.rs
parentc8066ebd1781a6f6f536abe3494477bd69df795a (diff)
Basic Support Macro 2.0
Diffstat (limited to 'crates/hir_def/src/nameres/tests/macros.rs')
-rw-r--r--crates/hir_def/src/nameres/tests/macros.rs22
1 files changed, 22 insertions, 0 deletions
diff --git a/crates/hir_def/src/nameres/tests/macros.rs b/crates/hir_def/src/nameres/tests/macros.rs
index 6d3cb8d7a..9986e99e4 100644
--- a/crates/hir_def/src/nameres/tests/macros.rs
+++ b/crates/hir_def/src/nameres/tests/macros.rs
@@ -837,3 +837,25 @@ fn collects_derive_helpers() {
837 _ => unreachable!(), 837 _ => unreachable!(),
838 } 838 }
839} 839}
840
841#[test]
842fn resolve_macro_def() {
843 check(
844 r#"
845//- /lib.rs
846pub macro structs($($i:ident),*) {
847 $(struct $i { field: u32 } )*
848}
849
850structs!(Foo);
851
852//- /nested.rs
853structs!(Bar, Baz);
854"#,
855 expect![[r#"
856 crate
857 Foo: t
858 structs: m
859 "#]],
860 );
861}