]> git.lizzy.rs Git - rust.git/blob - src/test/ui/borrowck/borrowck-overloaded-call.stderr
Rollup merge of #54257 - alexcrichton:wasm-math-symbols, r=TimNN
[rust.git] / src / test / ui / borrowck / borrowck-overloaded-call.stderr
1 error[E0502]: cannot borrow `s` as immutable because it is also borrowed as mutable
2   --> $DIR/borrowck-overloaded-call.rs:69:5
3    |
4 LL |     let sp = &mut s;
5    |                   - mutable borrow occurs here
6 LL |     s(3);   //~ ERROR cannot borrow `s` as immutable because it is also borrowed as mutable
7    |     ^ immutable borrow occurs here
8 LL | }
9    | - mutable borrow ends here
10
11 error[E0596]: cannot borrow immutable local variable `s` as mutable
12   --> $DIR/borrowck-overloaded-call.rs:77:5
13    |
14 LL |     let s = SFnMut {
15    |         - help: make this binding mutable: `mut s`
16 ...
17 LL |     s(3);   //~ ERROR cannot borrow immutable local variable `s` as mutable
18    |     ^ cannot borrow mutably
19
20 error[E0382]: use of moved value: `s`
21   --> $DIR/borrowck-overloaded-call.rs:85:5
22    |
23 LL |     s(" world".to_string());
24    |     - value moved here
25 LL |     s(" world".to_string());    //~ ERROR use of moved value: `s`
26    |     ^ value used here after move
27    |
28    = note: move occurs because `s` has type `SFnOnce`, which does not implement the `Copy` trait
29
30 error: aborting due to 3 previous errors
31
32 Some errors occurred: E0382, E0502, E0596.
33 For more information about an error, try `rustc --explain E0382`.