1 struct Foo {
2     pub v: Vec<String>
3 }
4 
main()5 fn main() {
6     let f = Foo { v: Vec::new() };
7     f.v.push("cat".to_string()); //~ ERROR cannot borrow
8 }
9 
10 
11 struct S {
12     x: i32,
13 }
foo()14 fn foo() {
15     let s = S { x: 42 };
16     s.x += 1; //~ ERROR cannot assign
17 }
18 
bar(s: S)19 fn bar(s: S) {
20     s.x += 1; //~ ERROR cannot assign
21 }
22