about summary refs log tree commit diff
diff options
context:
space:
mode:
authorShoyu Vanilla <modulo641@gmail.com>2024-02-27 23:53:43 +0900
committerShoyu Vanilla <modulo641@gmail.com>2024-02-27 23:54:05 +0900
commitd1bdebf2b969eee013de2c8f3a2512f799e00263 (patch)
tree25635fad56c06eabd83e508c49de9a45e4985679
parent6b250a22c41b2899b0735c5bc607e50c3d774d74 (diff)
downloadrust-d1bdebf2b969eee013de2c8f3a2512f799e00263.tar.gz
rust-d1bdebf2b969eee013de2c8f3a2512f799e00263.zip
Add a new failing test for goto deref_mut
-rw-r--r--crates/ide/src/goto_definition.rs27
1 files changed, 27 insertions, 0 deletions
diff --git a/crates/ide/src/goto_definition.rs b/crates/ide/src/goto_definition.rs
index 88255d222ed..35efe144e1b 100644
--- a/crates/ide/src/goto_definition.rs
+++ b/crates/ide/src/goto_definition.rs
@@ -1978,6 +1978,33 @@ fn f() {
     }
 
     #[test]
+    fn goto_deref_mut() {
+        check(
+            r#"
+//- minicore: deref, deref_mut
+
+struct Foo;
+struct Bar;
+
+impl core::ops::Deref for Foo {
+    type Target = Bar;
+    fn deref(&self) -> &Self::Target {}
+}
+
+impl core::ops::DerefMut for Foo {
+    fn deref_mut(&mut self) -> &mut Self::Target {}
+     //^^^^^^^^^
+}
+
+fn f() {
+    let a = Foo;
+    $0*a = Bar;
+}
+"#,
+        );
+    }
+
+    #[test]
     fn goto_bin_op() {
         check(
             r#"