aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_def/src/nameres/tests/diagnostics.rs
diff options
context:
space:
mode:
authorkazatsuyu <[email protected]>2021-01-22 13:28:45 +0000
committerkazatsuyu <[email protected]>2021-01-22 13:28:45 +0000
commite52589e3a72ed57d47956d16d90f4b15fc7408f0 (patch)
treec16f0615942094ac0e28ab3c8ef080833614c000 /crates/hir_def/src/nameres/tests/diagnostics.rs
parent2472851ccf22762065670e1cf00a9c39db869aac (diff)
Fix error when using "extern crate self as"
Diffstat (limited to 'crates/hir_def/src/nameres/tests/diagnostics.rs')
-rw-r--r--crates/hir_def/src/nameres/tests/diagnostics.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/crates/hir_def/src/nameres/tests/diagnostics.rs b/crates/hir_def/src/nameres/tests/diagnostics.rs
index 58d69d3c6..679a505dc 100644
--- a/crates/hir_def/src/nameres/tests/diagnostics.rs
+++ b/crates/hir_def/src/nameres/tests/diagnostics.rs
@@ -62,6 +62,21 @@ fn unresolved_extern_crate() {
62} 62}
63 63
64#[test] 64#[test]
65fn extern_crate_self_as() {
66 check_diagnostics(
67 r"
68 //- /lib.rs
69 extern crate doesnotexist;
70 //^^^^^^^^^^^^^^^^^^^^^^^^^^ unresolved extern crate
71 // Should not error.
72 extern crate self as foo;
73 struct Foo;
74 use foo::Foo as Bar;
75 ",
76 );
77}
78
79#[test]
65fn dedup_unresolved_import_from_unresolved_crate() { 80fn dedup_unresolved_import_from_unresolved_crate() {
66 check_diagnostics( 81 check_diagnostics(
67 r" 82 r"