aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_def/src/nameres/tests
diff options
context:
space:
mode:
authorJonas Schievink <[email protected]>2020-09-17 13:48:17 +0100
committerJonas Schievink <[email protected]>2020-09-17 13:48:17 +0100
commit0dca7acf0fb65545f0c46f0c604bb15400aa6d91 (patch)
tree7130de110e002f66618a6bc0329200a659f655d9 /crates/hir_def/src/nameres/tests
parentf792bc7ddd2616c0bb1fcdffda204151fc40b3d6 (diff)
Don't diagnose imports whose base crate is missing
Diffstat (limited to 'crates/hir_def/src/nameres/tests')
-rw-r--r--crates/hir_def/src/nameres/tests/diagnostics.rs24
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]
96fn 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]
96fn unresolved_module() { 120fn unresolved_module() {
97 check_diagnostics( 121 check_diagnostics(
98 r" 122 r"