| // 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. |
| //ignore-compare-mode-nll |
| //ignore-compare-mode-polonius |
| //[migrate2018] edition:2018 |
| #![cfg_attr(nll, feature(nll))] |
| let mut v = vec![0, 1, 2]; |
| //[base]~^ ERROR cannot borrow `v` as mutable |
| //[nll]~^^ ERROR cannot borrow `v` as mutable |
| fn activation_conflict() { |
| let mut v = vec![0, 1, 2]; |
| //[base]~^ ERROR cannot borrow `v` as mutable |
| //[nll]~^^ ERROR cannot borrow `v` as mutable |
| fn reservation_allowed() { |
| let mut v = vec![0, 1, 2]; |