diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-06-13 15:09:41 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2021-06-13 15:09:41 +0100 |
commit | 3d8df2aef87bca7ec3f0994d799462f08d1ad449 (patch) | |
tree | a43b94510193f1f58ec7bfc39814ae58f673ceca /crates/hir_def/src/nameres/tests | |
parent | e6fa9b016fab4bf38f4e2a798fcabcc13b58e9ab (diff) | |
parent | fa9ed4e0ce633e51d1411951bf044719e6837457 (diff) |
Merge #9248
9248: internal: refactor unresolved macro call diagnostic r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/hir_def/src/nameres/tests')
-rw-r--r-- | crates/hir_def/src/nameres/tests/diagnostics.rs | 68 |
1 files changed, 0 insertions, 68 deletions
diff --git a/crates/hir_def/src/nameres/tests/diagnostics.rs b/crates/hir_def/src/nameres/tests/diagnostics.rs index 84d6fdc93..5a088b6e5 100644 --- a/crates/hir_def/src/nameres/tests/diagnostics.rs +++ b/crates/hir_def/src/nameres/tests/diagnostics.rs | |||
@@ -13,43 +13,6 @@ fn check_no_diagnostics(ra_fixture: &str) { | |||
13 | } | 13 | } |
14 | 14 | ||
15 | #[test] | 15 | #[test] |
16 | fn unresolved_import() { | ||
17 | check_diagnostics( | ||
18 | r" | ||
19 | use does_exist; | ||
20 | use does_not_exist; | ||
21 | //^^^^^^^^^^^^^^^^^^^ UnresolvedImport | ||
22 | |||
23 | mod does_exist {} | ||
24 | ", | ||
25 | ); | ||
26 | } | ||
27 | |||
28 | #[test] | ||
29 | fn dedup_unresolved_import_from_unresolved_crate() { | ||
30 | check_diagnostics( | ||
31 | r" | ||
32 | //- /main.rs crate:main | ||
33 | mod a { | ||
34 | extern crate doesnotexist; | ||
35 | //^^^^^^^^^^^^^^^^^^^^^^^^^^ UnresolvedExternCrate | ||
36 | |||
37 | // Should not error, since we already errored for the missing crate. | ||
38 | use doesnotexist::{self, bla, *}; | ||
39 | |||
40 | use crate::doesnotexist; | ||
41 | //^^^^^^^^^^^^^^^^^^^^^^^^ UnresolvedImport | ||
42 | } | ||
43 | |||
44 | mod m { | ||
45 | use super::doesnotexist; | ||
46 | //^^^^^^^^^^^^^^^^^^^^^^^^ UnresolvedImport | ||
47 | } | ||
48 | ", | ||
49 | ); | ||
50 | } | ||
51 | |||
52 | #[test] | ||
53 | fn inactive_item() { | 16 | fn inactive_item() { |
54 | // Additional tests in `cfg` crate. This only tests disabled cfgs. | 17 | // Additional tests in `cfg` crate. This only tests disabled cfgs. |
55 | 18 | ||
@@ -92,37 +55,6 @@ fn inactive_via_cfg_attr() { | |||
92 | } | 55 | } |
93 | 56 | ||
94 | #[test] | 57 | #[test] |
95 | fn unresolved_legacy_scope_macro() { | ||
96 | check_diagnostics( | ||
97 | r#" | ||
98 | //- /lib.rs | ||
99 | macro_rules! m { () => {} } | ||
100 | |||
101 | m!(); | ||
102 | m2!(); | ||
103 | //^^^^^^ UnresolvedMacroCall | ||
104 | "#, | ||
105 | ); | ||
106 | } | ||
107 | |||
108 | #[test] | ||
109 | fn unresolved_module_scope_macro() { | ||
110 | check_diagnostics( | ||
111 | r#" | ||
112 | //- /lib.rs | ||
113 | mod mac { | ||
114 | #[macro_export] | ||
115 | macro_rules! m { () => {} } | ||
116 | } | ||
117 | |||
118 | self::m!(); | ||
119 | self::m2!(); | ||
120 | //^^^^^^^^^^^^ UnresolvedMacroCall | ||
121 | "#, | ||
122 | ); | ||
123 | } | ||
124 | |||
125 | #[test] | ||
126 | fn builtin_macro_fails_expansion() { | 58 | fn builtin_macro_fails_expansion() { |
127 | check_diagnostics( | 59 | check_diagnostics( |
128 | r#" | 60 | r#" |