mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-15 22:54:00 +00:00
test: add regression test for prelude shadowing in block modules
This commit is contained in:
parent
c330c62aa2
commit
22e82c72ac
1 changed files with 24 additions and 0 deletions
|
@ -2289,4 +2289,28 @@ macro_rules! baz {
|
||||||
"#,
|
"#,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn goto_shadowed_preludes_in_block_module() {
|
||||||
|
check(
|
||||||
|
r#"
|
||||||
|
//- /main.rs crate:main edition:2021 deps:core
|
||||||
|
pub struct S;
|
||||||
|
//^
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
fn f() -> S$0 {
|
||||||
|
fn inner() {} // forces a block def map
|
||||||
|
return S;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//- /core.rs crate:core
|
||||||
|
pub mod prelude {
|
||||||
|
pub mod rust_2021 {
|
||||||
|
pub enum S;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
"#,
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue