1 struct Foo { 2 pub v: Vec<String> 3 } 4 main()5fn 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()14fn foo() { 15 let s = S { x: 42 }; 16 s.x += 1; //~ ERROR cannot assign 17 } 18 bar(s: S)19fn bar(s: S) { 20 s.x += 1; //~ ERROR cannot assign 21 } 22