]>
Commit | Line | Data |
---|---|---|
48663c56 | 1 | error[E0596]: cannot borrow `b` as mutable, as it is not declared as mutable |
94222f64 | 2 | --> $DIR/mut-borrow-of-mut-ref.rs:7:7 |
94b46f34 | 3 | | |
94222f64 XL |
4 | LL | h(&mut b); |
5 | | ^^^^^^ cannot borrow as mutable | |
6 | | | |
7 | note: the binding is already a mutable borrow | |
8 | --> $DIR/mut-borrow-of-mut-ref.rs:4:13 | |
9 | | | |
10 | LL | pub fn f(b: &mut i32) { | |
11 | | ^^^^^^^^ | |
12 | help: try removing `&mut` here | |
13 | | | |
14 | LL - h(&mut b); | |
15 | LL + h(b); | |
923072b8 | 16 | | |
94b46f34 | 17 | |
29967ef6 | 18 | error[E0596]: cannot borrow `b` as mutable, as it is not declared as mutable |
94222f64 | 19 | --> $DIR/mut-borrow-of-mut-ref.rs:11:12 |
29967ef6 XL |
20 | | |
21 | LL | g(&mut &mut b); | |
94222f64 XL |
22 | | ^^^^^^ cannot borrow as mutable |
23 | | | |
24 | note: the binding is already a mutable borrow | |
25 | --> $DIR/mut-borrow-of-mut-ref.rs:4:13 | |
26 | | | |
27 | LL | pub fn f(b: &mut i32) { | |
28 | | ^^^^^^^^ | |
29 | help: try removing `&mut` here | |
30 | | | |
31 | LL - g(&mut &mut b); | |
32 | LL + g(&mut b); | |
923072b8 | 33 | | |
94222f64 XL |
34 | |
35 | error[E0596]: cannot borrow `b` as mutable, as it is not declared as mutable | |
36 | --> $DIR/mut-borrow-of-mut-ref.rs:18:12 | |
37 | | | |
38 | LL | h(&mut &mut b); | |
39 | | ^^^^^^ cannot borrow as mutable | |
40 | | | |
41 | note: the binding is already a mutable borrow | |
42 | --> $DIR/mut-borrow-of-mut-ref.rs:17:13 | |
43 | | | |
44 | LL | pub fn g(b: &mut i32) { | |
45 | | ^^^^^^^^ | |
46 | help: try removing `&mut` here | |
47 | | | |
48 | LL - h(&mut &mut b); | |
49 | LL + h(&mut b); | |
923072b8 | 50 | | |
94222f64 XL |
51 | |
52 | error[E0596]: cannot borrow `f` as mutable, as it is not declared as mutable | |
53 | --> $DIR/mut-borrow-of-mut-ref.rs:35:5 | |
54 | | | |
55 | LL | f.bar(); | |
c295e0f8 | 56 | | ^^^^^^^ cannot borrow as mutable |
94222f64 XL |
57 | | |
58 | help: consider making the binding mutable | |
59 | | | |
60 | LL | pub fn baz(mut f: &mut String) { | |
61 | | +++ | |
29967ef6 | 62 | |
94222f64 | 63 | error: aborting due to 4 previous errors |
94b46f34 XL |
64 | |
65 | For more information about this error, try `rustc --explain E0596`. |