Add regression test for need-mut diagnostic

This commit is contained in:
Chayim Refael Friedman 2025-10-05 21:56:08 +03:00
parent 8efe156db7
commit c7a6a799f0

View file

@ -1302,6 +1302,22 @@ fn main() {
let mut var = 1;
let mut func = || (var,) = (2,);
func();
}
"#,
);
}
#[test]
fn regression_20662() {
check_diagnostics(
r#"
//- minicore: index
pub trait A: core::ops::IndexMut<usize> {
type T: A;
}
fn func(a: &mut impl A, b: &mut [i32]) {
b[0] += 1;
}
"#,
);