mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 14:21:44 +00:00
Prefer names from outer DefMap over extern prelude
This commit is contained in:
parent
83280ea574
commit
c2622c9228
2 changed files with 40 additions and 5 deletions
|
@ -705,6 +705,35 @@ fn x(a: S) {
|
|||
)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn import_extern_crate_clash_with_inner_item() {
|
||||
// This is more of a resolver test, but doesn't really work with the hir_def testsuite.
|
||||
|
||||
check_diagnostics(
|
||||
r#"
|
||||
//- /lib.rs crate:lib deps:jwt
|
||||
mod permissions;
|
||||
|
||||
use permissions::jwt;
|
||||
|
||||
fn f() {
|
||||
fn inner() {}
|
||||
jwt::Claims {}; // should resolve to the local one with 0 fields, and not get a diagnostic
|
||||
}
|
||||
|
||||
//- /permissions.rs
|
||||
pub mod jwt {
|
||||
pub struct Claims {}
|
||||
}
|
||||
|
||||
//- /jwt/lib.rs crate:jwt
|
||||
pub struct Claims {
|
||||
field: u8,
|
||||
}
|
||||
"#,
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn break_outside_of_loop() {
|
||||
check_diagnostics(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue