diff options
Diffstat (limited to '')
-rw-r--r-- | tests/ui/borrowck/many-mutable-borrows.rs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/ui/borrowck/many-mutable-borrows.rs b/tests/ui/borrowck/many-mutable-borrows.rs new file mode 100644 index 000000000..3e6ea9d25 --- /dev/null +++ b/tests/ui/borrowck/many-mutable-borrows.rs @@ -0,0 +1,18 @@ +fn main() { + let v = Vec::new(); //~ ERROR cannot borrow `v` as mutable, as it is not declared as mutable + v.push(0); + v.push(0); + v.push(0); + v.push(0); + v.push(0); + v.push(0); + v.push(0); + v.push(0); + v.push(0); + v.push(0); + v.push(0); + v.push(0); + v.push(0); + v.push(0); + v.push(0); +} |