]> git.proxmox.com Git - rustc.git/blame - src/test/ui/span/borrowck-borrow-overloaded-auto-deref-mut.stderr
New upstream version 1.19.0+dfsg1
[rustc.git] / src / test / ui / span / borrowck-borrow-overloaded-auto-deref-mut.stderr
CommitLineData
7cac9316 1error[E0596]: cannot borrow immutable argument `x` as mutable
476ff2be
SL
2 --> $DIR/borrowck-borrow-overloaded-auto-deref-mut.rs:63:24
3 |
462 | fn deref_mut_field1(x: Own<Point>) {
cc61c64b 5 | - consider changing this to `mut x`
476ff2be
SL
663 | let __isize = &mut x.y; //~ ERROR cannot borrow
7 | ^ cannot borrow mutably
8
7cac9316 9error[E0596]: cannot borrow immutable borrowed content `*x` as mutable
476ff2be
SL
10 --> $DIR/borrowck-borrow-overloaded-auto-deref-mut.rs:75:10
11 |
1274 | fn deref_extend_mut_field1(x: &Own<Point>) -> &mut isize {
13 | ----------- use `&mut Own<Point>` here to make mutable
1475 | &mut x.y //~ ERROR cannot borrow
32a655c1 15 | ^ cannot borrow as mutable
476ff2be
SL
16
17error[E0499]: cannot borrow `*x` as mutable more than once at a time
18 --> $DIR/borrowck-borrow-overloaded-auto-deref-mut.rs:88:19
19 |
2087 | let _x = &mut x.x;
21 | - first mutable borrow occurs here
2288 | let _y = &mut x.y; //~ ERROR cannot borrow
23 | ^ second mutable borrow occurs here
2489 | }
25 | - first borrow ends here
26
7cac9316 27error[E0596]: cannot borrow immutable argument `x` as mutable
476ff2be
SL
28 --> $DIR/borrowck-borrow-overloaded-auto-deref-mut.rs:98:5
29 |
3097 | fn assign_field1<'a>(x: Own<Point>) {
cc61c64b 31 | - consider changing this to `mut x`
476ff2be
SL
3298 | x.y = 3; //~ ERROR cannot borrow
33 | ^ cannot borrow mutably
34
7cac9316 35error[E0596]: cannot borrow immutable borrowed content `*x` as mutable
476ff2be
SL
36 --> $DIR/borrowck-borrow-overloaded-auto-deref-mut.rs:102:5
37 |
38101 | fn assign_field2<'a>(x: &'a Own<Point>) {
39 | -------------- use `&'a mut Own<Point>` here to make mutable
40102 | x.y = 3; //~ ERROR cannot borrow
32a655c1 41 | ^ cannot borrow as mutable
476ff2be
SL
42
43error[E0499]: cannot borrow `*x` as mutable more than once at a time
44 --> $DIR/borrowck-borrow-overloaded-auto-deref-mut.rs:111:5
45 |
46110 | let _p: &mut Point = &mut **x;
47 | -- first mutable borrow occurs here
48111 | x.y = 3; //~ ERROR cannot borrow
49 | ^ second mutable borrow occurs here
50112 | }
51 | - first borrow ends here
52
7cac9316 53error[E0596]: cannot borrow immutable argument `x` as mutable
476ff2be
SL
54 --> $DIR/borrowck-borrow-overloaded-auto-deref-mut.rs:119:5
55 |
56118 | fn deref_mut_method1(x: Own<Point>) {
cc61c64b 57 | - consider changing this to `mut x`
476ff2be
SL
58119 | x.set(0, 0); //~ ERROR cannot borrow
59 | ^ cannot borrow mutably
60
7cac9316 61error[E0596]: cannot borrow immutable borrowed content `*x` as mutable
476ff2be
SL
62 --> $DIR/borrowck-borrow-overloaded-auto-deref-mut.rs:131:5
63 |
64130 | fn deref_extend_mut_method1(x: &Own<Point>) -> &mut isize {
65 | ----------- use `&mut Own<Point>` here to make mutable
66131 | x.y_mut() //~ ERROR cannot borrow
32a655c1 67 | ^ cannot borrow as mutable
476ff2be 68
7cac9316 69error[E0596]: cannot borrow immutable argument `x` as mutable
476ff2be
SL
70 --> $DIR/borrowck-borrow-overloaded-auto-deref-mut.rs:139:6
71 |
72138 | fn assign_method1<'a>(x: Own<Point>) {
cc61c64b 73 | - consider changing this to `mut x`
476ff2be
SL
74139 | *x.y_mut() = 3; //~ ERROR cannot borrow
75 | ^ cannot borrow mutably
76
7cac9316 77error[E0596]: cannot borrow immutable borrowed content `*x` as mutable
476ff2be
SL
78 --> $DIR/borrowck-borrow-overloaded-auto-deref-mut.rs:143:6
79 |
80142 | fn assign_method2<'a>(x: &'a Own<Point>) {
81 | -------------- use `&'a mut Own<Point>` here to make mutable
82143 | *x.y_mut() = 3; //~ ERROR cannot borrow
32a655c1 83 | ^ cannot borrow as mutable
476ff2be 84
7cac9316 85error: aborting due to previous error(s)
476ff2be 86