Add regression test for need-mut diagnostic
This commit is contained in:
parent
8efe156db7
commit
c7a6a799f0
1 changed files with 16 additions and 0 deletions
|
|
@ -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;
|
||||
}
|
||||
"#,
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue