diff options
author | Jonas Schievink <[email protected]> | 2021-05-20 18:56:04 +0100 |
---|---|---|
committer | Jonas Schievink <[email protected]> | 2021-05-20 18:56:04 +0100 |
commit | 036e5b2806256601408d91b5bbb4907bfb110760 (patch) | |
tree | 8742d859eed0fdd5a5ae8bb334718c514780350f /crates/hir_def/src/nameres/tests | |
parent | f088606d8946d992c61153dc7f208efdaf9fb12d (diff) |
Refactor name resolution to resolve derive helpers
Diffstat (limited to 'crates/hir_def/src/nameres/tests')
-rw-r--r-- | crates/hir_def/src/nameres/tests/macros.rs | 22 |
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 6eb5f97be..04de107f5 100644 --- a/crates/hir_def/src/nameres/tests/macros.rs +++ b/crates/hir_def/src/nameres/tests/macros.rs | |||
@@ -736,6 +736,28 @@ fn unresolved_attributes_fall_back_track_per_file_moditems() { | |||
736 | } | 736 | } |
737 | 737 | ||
738 | #[test] | 738 | #[test] |
739 | fn resolves_derive_helper() { | ||
740 | cov_mark::check!(resolved_derive_helper); | ||
741 | check( | ||
742 | r#" | ||
743 | //- /main.rs crate:main deps:proc | ||
744 | #[derive(proc::Derive)] | ||
745 | #[helper] | ||
746 | #[unresolved] | ||
747 | struct S; | ||
748 | |||
749 | //- /proc.rs crate:proc | ||
750 | #[proc_macro_derive(Derive, attributes(helper))] | ||
751 | fn derive() {} | ||
752 | "#, | ||
753 | expect![[r#" | ||
754 | crate | ||
755 | S: t v | ||
756 | "#]], | ||
757 | ) | ||
758 | } | ||
759 | |||
760 | #[test] | ||
739 | fn macro_expansion_overflow() { | 761 | fn macro_expansion_overflow() { |
740 | cov_mark::check!(macro_expansion_overflow); | 762 | cov_mark::check!(macro_expansion_overflow); |
741 | check( | 763 | check( |