mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
Add a new failing test for goto deref_mut
This commit is contained in:
parent
6b250a22c4
commit
d1bdebf2b9
1 changed files with 27 additions and 0 deletions
|
@ -1977,6 +1977,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]
|
#[test]
|
||||||
fn goto_bin_op() {
|
fn goto_bin_op() {
|
||||||
check(
|
check(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue