Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit d1bdebf

Browse files
committed
Add a new failing test for goto deref_mut
1 parent 6b250a2 commit d1bdebf

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

crates/ide/src/goto_definition.rs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1977,6 +1977,33 @@ fn f() {
19771977
);
19781978
}
19791979

1980+
#[test]
1981+
fn goto_deref_mut() {
1982+
check(
1983+
r#"
1984+
//- minicore: deref, deref_mut
1985+
1986+
struct Foo;
1987+
struct Bar;
1988+
1989+
impl core::ops::Deref for Foo {
1990+
type Target = Bar;
1991+
fn deref(&self) -> &Self::Target {}
1992+
}
1993+
1994+
impl core::ops::DerefMut for Foo {
1995+
fn deref_mut(&mut self) -> &mut Self::Target {}
1996+
//^^^^^^^^^
1997+
}
1998+
1999+
fn f() {
2000+
let a = Foo;
2001+
$0*a = Bar;
2002+
}
2003+
"#,
2004+
);
2005+
}
2006+
19802007
#[test]
19812008
fn goto_bin_op() {
19822009
check(

0 commit comments

Comments
 (0)