test: add regression test for prelude shadowing in block modules

This commit is contained in:
roife 2024-06-06 16:50:40 +08:00
parent c330c62aa2
commit 22e82c72ac

View file

@ -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;
}
}
"#,
);