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