mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-29 06:23:25 +00:00
Add a new failing test for Goto index_mut definition
This commit is contained in:
parent
0ac05c0527
commit
83f6dd14f8
1 changed files with 28 additions and 0 deletions
|
@ -1955,6 +1955,34 @@ fn f() {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn goto_index_mut_op() {
|
||||||
|
check(
|
||||||
|
r#"
|
||||||
|
//- minicore: index
|
||||||
|
|
||||||
|
struct Foo;
|
||||||
|
struct Bar;
|
||||||
|
|
||||||
|
impl core::ops::Index<usize> for Foo {
|
||||||
|
type Output = Bar;
|
||||||
|
|
||||||
|
fn index(&self, index: usize) -> &Self::Output {}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl core::ops::IndexMut<usize> for Foo {
|
||||||
|
fn index_mut(&mut self, index: usize) -> &mut Self::Output {}
|
||||||
|
//^^^^^^^^^
|
||||||
|
}
|
||||||
|
|
||||||
|
fn f() {
|
||||||
|
let mut foo = Foo;
|
||||||
|
foo[0]$0 = Bar;
|
||||||
|
}
|
||||||
|
"#,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn goto_prefix_op() {
|
fn goto_prefix_op() {
|
||||||
check(
|
check(
|
||||||
|
|
Loading…
Reference in a new issue