Logo
Explore Help
Register Sign In
rust-lang/rust
1
0
Fork 0
You've already forked rust
Code Issues Pull Requests Actions 1 Packages Projects Releases Wiki Activity
Files
359bfa901b9d8eddbed7b88b6716dbb77b7bfb95
rust/tests/ui/borrowck/writing-to-immutable-vec.rs

5 lines
140 B
Rust
Raw Normal View History

new borrow checker (mass squash)
2013-03-15 15:24:24 -04:00
fn main() {
Changed most vec! invocations to use square braces Most of the Rust community agrees that the vec! macro is clearer when called using square brackets [] instead of regular brackets (). Most of these ocurrences are from before macros allowed using different types of brackets. There is one left unchanged in a pretty-print test, as the pretty printer still wants it to have regular brackets.
2016-10-29 22:54:04 +01:00
let v: Vec<isize> = vec![1, 2, 3];
update tests for migrate mode by default
2019-04-22 08:40:08 +01:00
v[1] = 4; //~ ERROR cannot borrow `v` as mutable, as it is not declared as mutable
new borrow checker (mass squash)
2013-03-15 15:24:24 -04:00
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.6 Page: 6657ms Template: 3ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API