]>
Commit | Line | Data |
---|---|---|
48663c56 | 1 | error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable |
0731742a | 2 | --> $DIR/borrowck-borrow-overloaded-auto-deref-mut.rs:53:24 |
476ff2be | 3 | | |
0531ce1d | 4 | LL | fn deref_mut_field1(x: Own<Point>) { |
48663c56 | 5 | | - help: consider changing this to be mutable: `mut x` |
532ac7d7 | 6 | LL | let __isize = &mut x.y; |
48663c56 | 7 | | ^ cannot borrow as mutable |
476ff2be | 8 | |
48663c56 | 9 | error[E0596]: cannot borrow `*x` as mutable, as it is behind a `&` reference |
0731742a | 10 | --> $DIR/borrowck-borrow-overloaded-auto-deref-mut.rs:65:10 |
476ff2be | 11 | | |
0531ce1d | 12 | LL | fn deref_extend_mut_field1(x: &Own<Point>) -> &mut isize { |
48663c56 | 13 | | ----------- help: consider changing this to be a mutable reference: `&mut Own<Point>` |
532ac7d7 | 14 | LL | &mut x.y |
48663c56 | 15 | | ^ `x` is a `&` reference, so the data it refers to cannot be borrowed as mutable |
476ff2be SL |
16 | |
17 | error[E0499]: cannot borrow `*x` as mutable more than once at a time | |
0731742a | 18 | --> $DIR/borrowck-borrow-overloaded-auto-deref-mut.rs:78:19 |
476ff2be | 19 | | |
0531ce1d | 20 | LL | let _x = &mut x.x; |
476ff2be | 21 | | - first mutable borrow occurs here |
532ac7d7 | 22 | LL | let _y = &mut x.y; |
476ff2be | 23 | | ^ second mutable borrow occurs here |
a1dfa0c6 | 24 | LL | use_mut(_x); |
48663c56 | 25 | | -- first borrow later used here |
476ff2be | 26 | |
48663c56 | 27 | error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable |
0731742a | 28 | --> $DIR/borrowck-borrow-overloaded-auto-deref-mut.rs:88:5 |
476ff2be | 29 | | |
0531ce1d | 30 | LL | fn assign_field1<'a>(x: Own<Point>) { |
48663c56 | 31 | | - help: consider changing this to be mutable: `mut x` |
532ac7d7 | 32 | LL | x.y = 3; |
48663c56 | 33 | | ^ cannot borrow as mutable |
476ff2be | 34 | |
48663c56 | 35 | error[E0596]: cannot borrow `*x` as mutable, as it is behind a `&` reference |
0731742a | 36 | --> $DIR/borrowck-borrow-overloaded-auto-deref-mut.rs:92:5 |
0531ce1d XL |
37 | | |
38 | LL | fn assign_field2<'a>(x: &'a Own<Point>) { | |
48663c56 | 39 | | -------------- help: consider changing this to be a mutable reference: `&'a mut Own<Point>` |
532ac7d7 | 40 | LL | x.y = 3; |
48663c56 | 41 | | ^ `x` is a `&` reference, so the data it refers to cannot be borrowed as mutable |
476ff2be SL |
42 | |
43 | error[E0499]: cannot borrow `*x` as mutable more than once at a time | |
0731742a | 44 | --> $DIR/borrowck-borrow-overloaded-auto-deref-mut.rs:101:5 |
0531ce1d XL |
45 | | |
46 | LL | let _p: &mut Point = &mut **x; | |
47 | | -- first mutable borrow occurs here | |
532ac7d7 | 48 | LL | x.y = 3; |
0531ce1d | 49 | | ^ second mutable borrow occurs here |
a1dfa0c6 | 50 | LL | use_mut(_p); |
48663c56 | 51 | | -- first borrow later used here |
476ff2be | 52 | |
48663c56 | 53 | error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable |
0731742a | 54 | --> $DIR/borrowck-borrow-overloaded-auto-deref-mut.rs:109:5 |
0531ce1d XL |
55 | | |
56 | LL | fn deref_mut_method1(x: Own<Point>) { | |
48663c56 | 57 | | - help: consider changing this to be mutable: `mut x` |
532ac7d7 | 58 | LL | x.set(0, 0); |
c295e0f8 | 59 | | ^^^^^^^^^^^ cannot borrow as mutable |
476ff2be | 60 | |
48663c56 | 61 | error[E0596]: cannot borrow `*x` as mutable, as it is behind a `&` reference |
0731742a | 62 | --> $DIR/borrowck-borrow-overloaded-auto-deref-mut.rs:121:5 |
0531ce1d XL |
63 | | |
64 | LL | fn deref_extend_mut_method1(x: &Own<Point>) -> &mut isize { | |
48663c56 | 65 | | ----------- help: consider changing this to be a mutable reference: `&mut Own<Point>` |
532ac7d7 | 66 | LL | x.y_mut() |
c295e0f8 | 67 | | ^^^^^^^^^ `x` is a `&` reference, so the data it refers to cannot be borrowed as mutable |
476ff2be | 68 | |
48663c56 | 69 | error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable |
0731742a | 70 | --> $DIR/borrowck-borrow-overloaded-auto-deref-mut.rs:129:6 |
0531ce1d XL |
71 | | |
72 | LL | fn assign_method1<'a>(x: Own<Point>) { | |
48663c56 | 73 | | - help: consider changing this to be mutable: `mut x` |
532ac7d7 | 74 | LL | *x.y_mut() = 3; |
c295e0f8 | 75 | | ^^^^^^^^^ cannot borrow as mutable |
476ff2be | 76 | |
48663c56 | 77 | error[E0596]: cannot borrow `*x` as mutable, as it is behind a `&` reference |
0731742a | 78 | --> $DIR/borrowck-borrow-overloaded-auto-deref-mut.rs:133:6 |
0531ce1d XL |
79 | | |
80 | LL | fn assign_method2<'a>(x: &'a Own<Point>) { | |
48663c56 | 81 | | -------------- help: consider changing this to be a mutable reference: `&'a mut Own<Point>` |
532ac7d7 | 82 | LL | *x.y_mut() = 3; |
c295e0f8 | 83 | | ^^^^^^^^^ `x` is a `&` reference, so the data it refers to cannot be borrowed as mutable |
476ff2be | 84 | |
041b39d2 | 85 | error: aborting due to 10 previous errors |
476ff2be | 86 | |
48663c56 | 87 | Some errors have detailed explanations: E0499, E0596. |
0531ce1d | 88 | For more information about an error, try `rustc --explain E0499`. |