diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-01-23 04:04:09 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2021-01-23 04:04:09 +0000 |
commit | eab5db20edd9604ba5d489fa8c6430eb7bac6610 (patch) | |
tree | f486df3f2cacfa60f712148e13a08c2e78c641d2 /crates/hir_def/src/nameres/tests | |
parent | f301da3c3d1c73dd9d438cb0736e23430287dba7 (diff) | |
parent | 90d6740e3237e396f437619d115b8595d2242392 (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.rs | 16 |
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] |
65 | fn 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] | ||
65 | fn dedup_unresolved_import_from_unresolved_crate() { | 81 | fn dedup_unresolved_import_from_unresolved_crate() { |
66 | check_diagnostics( | 82 | check_diagnostics( |
67 | r" | 83 | r" |