2022-04-20 21:06:44 -05:00
|
|
|
// Test for #56254. The last example originally failed with the ast checker, was
|
|
|
|
// accidentally allowed under migrate/nll, then linted against in migrate mode
|
|
|
|
// but disallowed under NLL. Now, we accept it everywhere.
|
2019-03-01 14:09:54 -06:00
|
|
|
|
2019-06-11 12:02:13 -05:00
|
|
|
//ignore-compare-mode-polonius
|
2019-03-01 14:09:54 -06:00
|
|
|
|
|
|
|
fn double_conflicts() {
|
2017-12-06 05:25:36 -06:00
|
|
|
let mut v = vec![0, 1, 2];
|
|
|
|
let shared = &v;
|
|
|
|
|
2019-03-01 14:09:54 -06:00
|
|
|
v.extend(shared);
|
2022-04-01 12:13:25 -05:00
|
|
|
//~^ ERROR cannot borrow `v` as mutable
|
2019-03-01 14:09:54 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
fn activation_conflict() {
|
|
|
|
let mut v = vec![0, 1, 2];
|
|
|
|
|
|
|
|
v.extend(&v);
|
2022-04-01 12:13:25 -05:00
|
|
|
//~^ ERROR cannot borrow `v` as mutable
|
2019-03-01 14:09:54 -06:00
|
|
|
}
|
|
|
|
|
2022-04-20 21:06:44 -05:00
|
|
|
fn reservation_allowed() {
|
2019-03-01 14:09:54 -06:00
|
|
|
let mut v = vec![0, 1, 2];
|
|
|
|
let shared = &v;
|
2017-12-06 05:25:36 -06:00
|
|
|
|
2019-03-01 14:09:54 -06:00
|
|
|
v.push(shared.len());
|
2017-12-06 05:25:36 -06:00
|
|
|
}
|
2019-03-01 14:09:54 -06:00
|
|
|
|
|
|
|
fn main() {}
|