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.rs15
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 c521dbf167..8609ba4103 100644
--- a/crates/hir-ty/src/tests/method_resolution.rs
+++ b/crates/hir-ty/src/tests/method_resolution.rs
@@ -1774,6 +1774,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#"