]>
Commit | Line | Data |
---|---|---|
7cac9316 | 1 | error[E0596]: cannot borrow immutable argument `x` as mutable |
476ff2be SL |
2 | --> $DIR/borrowck-borrow-overloaded-auto-deref-mut.rs:63:24 |
3 | | | |
4 | 62 | fn deref_mut_field1(x: Own<Point>) { | |
cc61c64b | 5 | | - consider changing this to `mut x` |
476ff2be SL |
6 | 63 | let __isize = &mut x.y; //~ ERROR cannot borrow |
7 | | ^ cannot borrow mutably | |
8 | ||
7cac9316 | 9 | error[E0596]: cannot borrow immutable borrowed content `*x` as mutable |
476ff2be SL |
10 | --> $DIR/borrowck-borrow-overloaded-auto-deref-mut.rs:75:10 |
11 | | | |
12 | 74 | fn deref_extend_mut_field1(x: &Own<Point>) -> &mut isize { | |
13 | | ----------- use `&mut Own<Point>` here to make mutable | |
14 | 75 | &mut x.y //~ ERROR cannot borrow | |
32a655c1 | 15 | | ^ cannot borrow as mutable |
476ff2be SL |
16 | |
17 | error[E0499]: cannot borrow `*x` as mutable more than once at a time | |
18 | --> $DIR/borrowck-borrow-overloaded-auto-deref-mut.rs:88:19 | |
19 | | | |
20 | 87 | let _x = &mut x.x; | |
21 | | - first mutable borrow occurs here | |
22 | 88 | let _y = &mut x.y; //~ ERROR cannot borrow | |
23 | | ^ second mutable borrow occurs here | |
24 | 89 | } | |
25 | | - first borrow ends here | |
26 | ||
7cac9316 | 27 | error[E0596]: cannot borrow immutable argument `x` as mutable |
476ff2be SL |
28 | --> $DIR/borrowck-borrow-overloaded-auto-deref-mut.rs:98:5 |
29 | | | |
30 | 97 | fn assign_field1<'a>(x: Own<Point>) { | |
cc61c64b | 31 | | - consider changing this to `mut x` |
476ff2be SL |
32 | 98 | x.y = 3; //~ ERROR cannot borrow |
33 | | ^ cannot borrow mutably | |
34 | ||
7cac9316 | 35 | error[E0596]: cannot borrow immutable borrowed content `*x` as mutable |
476ff2be SL |
36 | --> $DIR/borrowck-borrow-overloaded-auto-deref-mut.rs:102:5 |
37 | | | |
38 | 101 | fn assign_field2<'a>(x: &'a Own<Point>) { | |
39 | | -------------- use `&'a mut Own<Point>` here to make mutable | |
40 | 102 | x.y = 3; //~ ERROR cannot borrow | |
32a655c1 | 41 | | ^ cannot borrow as mutable |
476ff2be SL |
42 | |
43 | error[E0499]: cannot borrow `*x` as mutable more than once at a time | |
44 | --> $DIR/borrowck-borrow-overloaded-auto-deref-mut.rs:111:5 | |
45 | | | |
46 | 110 | let _p: &mut Point = &mut **x; | |
47 | | -- first mutable borrow occurs here | |
48 | 111 | x.y = 3; //~ ERROR cannot borrow | |
49 | | ^ second mutable borrow occurs here | |
50 | 112 | } | |
51 | | - first borrow ends here | |
52 | ||
7cac9316 | 53 | error[E0596]: cannot borrow immutable argument `x` as mutable |
476ff2be SL |
54 | --> $DIR/borrowck-borrow-overloaded-auto-deref-mut.rs:119:5 |
55 | | | |
56 | 118 | fn deref_mut_method1(x: Own<Point>) { | |
cc61c64b | 57 | | - consider changing this to `mut x` |
476ff2be SL |
58 | 119 | x.set(0, 0); //~ ERROR cannot borrow |
59 | | ^ cannot borrow mutably | |
60 | ||
7cac9316 | 61 | error[E0596]: cannot borrow immutable borrowed content `*x` as mutable |
476ff2be SL |
62 | --> $DIR/borrowck-borrow-overloaded-auto-deref-mut.rs:131:5 |
63 | | | |
64 | 130 | fn deref_extend_mut_method1(x: &Own<Point>) -> &mut isize { | |
65 | | ----------- use `&mut Own<Point>` here to make mutable | |
66 | 131 | x.y_mut() //~ ERROR cannot borrow | |
32a655c1 | 67 | | ^ cannot borrow as mutable |
476ff2be | 68 | |
7cac9316 | 69 | error[E0596]: cannot borrow immutable argument `x` as mutable |
476ff2be SL |
70 | --> $DIR/borrowck-borrow-overloaded-auto-deref-mut.rs:139:6 |
71 | | | |
72 | 138 | fn assign_method1<'a>(x: Own<Point>) { | |
cc61c64b | 73 | | - consider changing this to `mut x` |
476ff2be SL |
74 | 139 | *x.y_mut() = 3; //~ ERROR cannot borrow |
75 | | ^ cannot borrow mutably | |
76 | ||
7cac9316 | 77 | error[E0596]: cannot borrow immutable borrowed content `*x` as mutable |
476ff2be SL |
78 | --> $DIR/borrowck-borrow-overloaded-auto-deref-mut.rs:143:6 |
79 | | | |
80 | 142 | fn assign_method2<'a>(x: &'a Own<Point>) { | |
81 | | -------------- use `&'a mut Own<Point>` here to make mutable | |
82 | 143 | *x.y_mut() = 3; //~ ERROR cannot borrow | |
32a655c1 | 83 | | ^ cannot borrow as mutable |
476ff2be | 84 | |
7cac9316 | 85 | error: aborting due to previous error(s) |
476ff2be | 86 |