Add a new failing test for Goto index_mut definition

This commit is contained in:
Shoyu Vanilla 2024-02-29 00:52:30 +09:00
parent 0ac05c0527
commit 83f6dd14f8

View file

@ -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]
fn goto_prefix_op() {
check(