aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_def/src/nameres/tests
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-01-23 04:04:09 +0000
committerGitHub <[email protected]>2021-01-23 04:04:09 +0000
commiteab5db20edd9604ba5d489fa8c6430eb7bac6610 (patch)
treef486df3f2cacfa60f712148e13a08c2e78c641d2 /crates/hir_def/src/nameres/tests
parentf301da3c3d1c73dd9d438cb0736e23430287dba7 (diff)
parent90d6740e3237e396f437619d115b8595d2242392 (diff)
Merge #7391
7391: Fix error when using "extern crate self as" r=kazatsuyu a=kazatsuyu Fix #6957 Co-authored-by: kazatsuyu <[email protected]>
Diffstat (limited to 'crates/hir_def/src/nameres/tests')
-rw-r--r--crates/hir_def/src/nameres/tests/diagnostics.rs16
1 files changed, 16 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..e8e72e5ef 100644
--- a/crates/hir_def/src/nameres/tests/diagnostics.rs
+++ b/crates/hir_def/src/nameres/tests/diagnostics.rs
@@ -62,6 +62,22 @@ fn unresolved_extern_crate() {
62} 62}
63 63
64#[test] 64#[test]
65fn extern_crate_self_as() {
66 mark::check!(extern_crate_self_as);
67 check_diagnostics(
68 r"
69 //- /lib.rs
70 extern crate doesnotexist;
71 //^^^^^^^^^^^^^^^^^^^^^^^^^^ unresolved extern crate
72 // Should not error.
73 extern crate self as foo;
74 struct Foo;
75 use foo::Foo as Bar;
76 ",
77 );
78}
79
80#[test]
65fn dedup_unresolved_import_from_unresolved_crate() { 81fn dedup_unresolved_import_from_unresolved_crate() {
66 check_diagnostics( 82 check_diagnostics(
67 r" 83 r"