diff options
author | Jonas Schievink <[email protected]> | 2020-09-17 13:48:17 +0100 |
---|---|---|
committer | Jonas Schievink <[email protected]> | 2020-09-17 13:48:17 +0100 |
commit | 0dca7acf0fb65545f0c46f0c604bb15400aa6d91 (patch) | |
tree | 7130de110e002f66618a6bc0329200a659f655d9 /crates/hir_def/src/nameres/tests/diagnostics.rs | |
parent | f792bc7ddd2616c0bb1fcdffda204151fc40b3d6 (diff) |
Don't diagnose imports whose base crate is missing
Diffstat (limited to 'crates/hir_def/src/nameres/tests/diagnostics.rs')
-rw-r--r-- | crates/hir_def/src/nameres/tests/diagnostics.rs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/crates/hir_def/src/nameres/tests/diagnostics.rs b/crates/hir_def/src/nameres/tests/diagnostics.rs index cd0eb1a4b..576b813d2 100644 --- a/crates/hir_def/src/nameres/tests/diagnostics.rs +++ b/crates/hir_def/src/nameres/tests/diagnostics.rs | |||
@@ -93,6 +93,30 @@ fn unresolved_extern_crate() { | |||
93 | } | 93 | } |
94 | 94 | ||
95 | #[test] | 95 | #[test] |
96 | fn dedup_unresolved_import_from_unresolved_crate() { | ||
97 | check_diagnostics( | ||
98 | r" | ||
99 | //- /main.rs crate:main | ||
100 | mod a { | ||
101 | extern crate doesnotexist; | ||
102 | //^^^^^^^^^^^^^^^^^^^^^^^^^^ unresolved extern crate | ||
103 | |||
104 | // Should not error, since we already errored for the missing crate. | ||
105 | use doesnotexist::{self, bla, *}; | ||
106 | |||
107 | use crate::doesnotexist; | ||
108 | //^^^^^^^^^^^^^^^^^^^ unresolved import | ||
109 | } | ||
110 | |||
111 | mod m { | ||
112 | use super::doesnotexist; | ||
113 | //^^^^^^^^^^^^^^^^^^^ unresolved import | ||
114 | } | ||
115 | ", | ||
116 | ); | ||
117 | } | ||
118 | |||
119 | #[test] | ||
96 | fn unresolved_module() { | 120 | fn unresolved_module() { |
97 | check_diagnostics( | 121 | check_diagnostics( |
98 | r" | 122 | r" |