2022-04-21 02:06:44 +00: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 20:09:54 +00:00
|
|
|
|
2019-06-11 17:02:13 +00:00
|
|
|
//@ignore-compare-mode-polonius
|
2019-03-01 20:09:54 +00:00
|
|
|
|
|
|
|
fn double_conflicts() {
|
2017-12-06 11:25:36 +00:00
|
|
|
let mut v = vec![0, 1, 2];
|
|
|
|
let shared = &v;
|
|
|
|
|
2019-03-01 20:09:54 +00:00
|
|
|
v.extend(shared);
|
2022-04-01 17:13:25 +00:00
|
|
|
//~^ ERROR cannot borrow `v` as mutable
|
2019-03-01 20:09:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
fn activation_conflict() {
|
|
|
|
let mut v = vec![0, 1, 2];
|
|
|
|
|
|
|
|
v.extend(&v);
|
2022-04-01 17:13:25 +00:00
|
|
|
//~^ ERROR cannot borrow `v` as mutable
|
2019-03-01 20:09:54 +00:00
|
|
|
}
|
|
|
|
|
2022-04-21 02:06:44 +00:00
|
|
|
fn reservation_allowed() {
|
2019-03-01 20:09:54 +00:00
|
|
|
let mut v = vec![0, 1, 2];
|
|
|
|
let shared = &v;
|
2017-12-06 11:25:36 +00:00
|
|
|
|
2019-03-01 20:09:54 +00:00
|
|
|
v.push(shared.len());
|
2017-12-06 11:25:36 +00:00
|
|
|
}
|
2019-03-01 20:09:54 +00:00
|
|
|
|
|
|
|
fn main() {}
|