mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 14:51:48 +00:00
Merge #9247
9247: internal: refactor unresolved extern crate diagnostic r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
This commit is contained in:
commit
e6fa9b016f
5 changed files with 60 additions and 54 deletions
|
@ -25,35 +25,6 @@ fn unresolved_import() {
|
|||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn unresolved_extern_crate() {
|
||||
check_diagnostics(
|
||||
r"
|
||||
//- /main.rs crate:main deps:core
|
||||
extern crate core;
|
||||
extern crate doesnotexist;
|
||||
//^^^^^^^^^^^^^^^^^^^^^^^^^^ UnresolvedExternCrate
|
||||
//- /lib.rs crate:core
|
||||
",
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn extern_crate_self_as() {
|
||||
cov_mark::check!(extern_crate_self_as);
|
||||
check_diagnostics(
|
||||
r"
|
||||
//- /lib.rs
|
||||
extern crate doesnotexist;
|
||||
//^^^^^^^^^^^^^^^^^^^^^^^^^^ UnresolvedExternCrate
|
||||
// Should not error.
|
||||
extern crate self as foo;
|
||||
struct Foo;
|
||||
use foo::Foo as Bar;
|
||||
",
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn dedup_unresolved_import_from_unresolved_crate() {
|
||||
check_diagnostics(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue