]> git.proxmox.com Git - rustc.git/blame - src/test/ui/borrowck/borrow-raw-address-of-mutability.stderr
Update unsuspicious file list
[rustc.git] / src / test / ui / borrowck / borrow-raw-address-of-mutability.stderr
CommitLineData
dfeec247
XL
1error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable
2 --> $DIR/borrow-raw-address-of-mutability.rs:5:13
3 |
4LL | let x = 0;
5 | - help: consider changing this to be mutable: `mut x`
6LL | let y = &raw mut x;
7 | ^^^^^^^^^^ cannot borrow as mutable
8
9error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable
10 --> $DIR/borrow-raw-address-of-mutability.rs:11:17
11 |
12LL | let x = 0;
13 | - help: consider changing this to be mutable: `mut x`
14LL | let mut f = || {
15LL | let y = &raw mut x;
16 | ^^^^^^^^^^ cannot borrow as mutable
17
18error[E0596]: cannot borrow `f` as mutable, as it is not declared as mutable
19 --> $DIR/borrow-raw-address-of-mutability.rs:21:5
20 |
21LL | let f = || {
22 | - help: consider changing this to be mutable: `mut f`
5869c6ff
XL
23LL | let y = &raw mut x;
24 | - calling `f` requires mutable binding due to mutable borrow of `x`
25LL | };
dfeec247
XL
26LL | f();
27 | ^ cannot borrow as mutable
28
29error[E0596]: cannot borrow `x` as mutable, as it is a captured variable in a `Fn` closure
30 --> $DIR/borrow-raw-address-of-mutability.rs:29:17
31 |
064997fb
FG
32LL | fn make_fn<F: Fn()>(f: F) -> F { f }
33 | - change this to accept `FnMut` instead of `Fn`
74b04a01 34...
064997fb
FG
35LL | let f = make_fn(|| {
36 | ------- -- in this closure
37 | |
38 | expects `Fn` instead of `FnMut`
39LL | let y = &raw mut x;
40 | ^^^^^^^^^^ cannot borrow as mutable
dfeec247
XL
41
42error[E0596]: cannot borrow `x` as mutable, as it is a captured variable in a `Fn` closure
43 --> $DIR/borrow-raw-address-of-mutability.rs:37:17
44 |
064997fb
FG
45LL | fn make_fn<F: Fn()>(f: F) -> F { f }
46 | - change this to accept `FnMut` instead of `Fn`
74b04a01 47...
064997fb
FG
48LL | let f = make_fn(move || {
49 | ------- ------- in this closure
50 | |
51 | expects `Fn` instead of `FnMut`
52LL | let y = &raw mut x;
53 | ^^^^^^^^^^ cannot borrow as mutable
dfeec247
XL
54
55error: aborting due to 5 previous errors
56
57For more information about this error, try `rustc --explain E0596`.