diff options
Diffstat (limited to 'crates/hir_ty/src/tests')
| -rw-r--r-- | crates/hir_ty/src/tests/traits.rs | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/crates/hir_ty/src/tests/traits.rs b/crates/hir_ty/src/tests/traits.rs index 528092082..e185b1c0a 100644 --- a/crates/hir_ty/src/tests/traits.rs +++ b/crates/hir_ty/src/tests/traits.rs | |||
| @@ -3174,6 +3174,39 @@ fn f() { | |||
| 3174 | } | 3174 | } |
| 3175 | 3175 | ||
| 3176 | #[test] | 3176 | #[test] |
| 3177 | fn trait_in_scope_with_inner_item() { | ||
| 3178 | check_infer( | ||
| 3179 | r#" | ||
| 3180 | mod m { | ||
| 3181 | pub trait Tr { | ||
| 3182 | fn method(&self) -> u8 { 0 } | ||
| 3183 | } | ||
| 3184 | |||
| 3185 | impl Tr for () {} | ||
| 3186 | } | ||
| 3187 | |||
| 3188 | use m::Tr; | ||
| 3189 | |||
| 3190 | fn f() { | ||
| 3191 | fn inner() { | ||
| 3192 | ().method(); | ||
| 3193 | //^^^^^^^^^^^ u8 | ||
| 3194 | } | ||
| 3195 | } | ||
| 3196 | "#, | ||
| 3197 | expect![[r#" | ||
| 3198 | 46..50 'self': &Self | ||
| 3199 | 58..63 '{ 0 }': u8 | ||
| 3200 | 60..61 '0': u8 | ||
| 3201 | 115..185 '{ ... } }': () | ||
| 3202 | 132..183 '{ ... }': () | ||
| 3203 | 142..144 '()': () | ||
| 3204 | 142..153 '().method()': u8 | ||
| 3205 | "#]], | ||
| 3206 | ); | ||
| 3207 | } | ||
| 3208 | |||
| 3209 | #[test] | ||
| 3177 | fn inner_use_in_block() { | 3210 | fn inner_use_in_block() { |
| 3178 | check_types( | 3211 | check_types( |
| 3179 | r#" | 3212 | r#" |
