diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-03-28 16:43:11 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2021-03-28 16:43:11 +0100 |
commit | bb1d925dab36372c6bd1fb5671bb68ce938ff009 (patch) | |
tree | ad32fbab8caf6563961b1366c726d8323fb303f5 /crates/hir_def/src/nameres/tests | |
parent | ce6bb5ccca48b177f6cd12b42b4c52f3e1b44e0c (diff) | |
parent | 772987911851d6480ec8c905c0cac1e2f881152c (diff) |
Merge #8212
8212: Basic support macro 2.0 r=jonas-schievink a=edwin0cheng
Turn out it is quite straight forward :)
r @jonas-schievink
![m2](https://user-images.githubusercontent.com/11014119/112712565-6eb99380-8f0b-11eb-88de-5d7f974dfe6d.png)
Co-authored-by: Edwin Cheng <[email protected]>
Diffstat (limited to 'crates/hir_def/src/nameres/tests')
-rw-r--r-- | crates/hir_def/src/nameres/tests/macros.rs | 18 |
1 files changed, 18 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..c37f915ab 100644 --- a/crates/hir_def/src/nameres/tests/macros.rs +++ b/crates/hir_def/src/nameres/tests/macros.rs | |||
@@ -837,3 +837,21 @@ fn collects_derive_helpers() { | |||
837 | _ => unreachable!(), | 837 | _ => unreachable!(), |
838 | } | 838 | } |
839 | } | 839 | } |
840 | |||
841 | #[test] | ||
842 | fn resolve_macro_def() { | ||
843 | check( | ||
844 | r#" | ||
845 | //- /lib.rs | ||
846 | pub macro structs($($i:ident),*) { | ||
847 | $(struct $i { field: u32 } )* | ||
848 | } | ||
849 | structs!(Foo); | ||
850 | "#, | ||
851 | expect![[r#" | ||
852 | crate | ||
853 | Foo: t | ||
854 | structs: m | ||
855 | "#]], | ||
856 | ); | ||
857 | } | ||