Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-ty/src/tests/method_resolution.rs')
| -rw-r--r-- | crates/hir-ty/src/tests/method_resolution.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/crates/hir-ty/src/tests/method_resolution.rs b/crates/hir-ty/src/tests/method_resolution.rs index c837fae3fe..049941a94f 100644 --- a/crates/hir-ty/src/tests/method_resolution.rs +++ b/crates/hir-ty/src/tests/method_resolution.rs @@ -1796,6 +1796,21 @@ fn test() { } #[test] +fn deref_into_inference_var() { + check_types( + r#" +//- minicore:deref +struct A<T>(T); +impl core::ops::Deref for A<u32> {} +impl A<i32> { fn foo(&self) {} } +fn main() { + A(0).foo(); + //^^^^^^^^^^ () +} +"#, + ); +} +#[test] fn receiver_adjustment_autoref() { check( r#" |