Only populate prelude for crate-level DefMaps

This commit is contained in:
Jonas Schievink 2021-04-02 19:00:26 +02:00
parent f4d56989b6
commit 7ceaba21df
2 changed files with 57 additions and 13 deletions

View file

@ -3897,4 +3897,46 @@ trait A where
"#]],
);
}
#[test]
fn string_shadowed_with_inner_items() {
check(
r#"
//- /main.rs crate:main deps:alloc
/// Custom `String` type.
struct String;
fn f() {
let _: String$0;
fn inner() {}
}
//- /alloc.rs crate:alloc
#[prelude_import]
pub use string::*;
mod string {
/// This is `alloc::String`.
pub struct String;
}
"#,
expect![[r#"
*String*
```rust
main
```
```rust
struct String
```
---
Custom `String` type.
"#]],
)
}
}