diff options
author | Jonas Schievink <[email protected]> | 2021-04-02 18:00:26 +0100 |
---|---|---|
committer | Jonas Schievink <[email protected]> | 2021-04-02 18:00:26 +0100 |
commit | 7ceaba21dff56ea46f2327895f34a00dc558464d (patch) | |
tree | 0388586d9388710da07d45ba4e1d190c4194da9a /crates/ide | |
parent | f4d56989b657b15aec6675cf1ba697e3f87eb088 (diff) |
Only populate prelude for crate-level DefMaps
Diffstat (limited to 'crates/ide')
-rw-r--r-- | crates/ide/src/hover.rs | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/crates/ide/src/hover.rs b/crates/ide/src/hover.rs index 28e2e17dc..614433417 100644 --- a/crates/ide/src/hover.rs +++ b/crates/ide/src/hover.rs | |||
@@ -3897,4 +3897,46 @@ trait A where | |||
3897 | "#]], | 3897 | "#]], |
3898 | ); | 3898 | ); |
3899 | } | 3899 | } |
3900 | |||
3901 | #[test] | ||
3902 | fn string_shadowed_with_inner_items() { | ||
3903 | check( | ||
3904 | r#" | ||
3905 | //- /main.rs crate:main deps:alloc | ||
3906 | |||
3907 | /// Custom `String` type. | ||
3908 | struct String; | ||
3909 | |||
3910 | fn f() { | ||
3911 | let _: String$0; | ||
3912 | |||
3913 | fn inner() {} | ||
3914 | } | ||
3915 | |||
3916 | //- /alloc.rs crate:alloc | ||
3917 | #[prelude_import] | ||
3918 | pub use string::*; | ||
3919 | |||
3920 | mod string { | ||
3921 | /// This is `alloc::String`. | ||
3922 | pub struct String; | ||
3923 | } | ||
3924 | "#, | ||
3925 | expect![[r#" | ||
3926 | *String* | ||
3927 | |||
3928 | ```rust | ||
3929 | main | ||
3930 | ``` | ||
3931 | |||
3932 | ```rust | ||
3933 | struct String | ||
3934 | ``` | ||
3935 | |||
3936 | --- | ||
3937 | |||
3938 | Custom `String` type. | ||
3939 | "#]], | ||
3940 | ) | ||
3941 | } | ||
3900 | } | 3942 | } |