mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-28 14:03:35 +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
|
@ -2285,6 +2285,30 @@ macro_rules! bar {
|
|||
#[macro_export]
|
||||
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