]> git.lizzy.rs Git - rust.git/blob - src/test/ui/borrowck/borrowck-overloaded-call.stderr
Rollup merge of #91312 - terrarier2111:anon-const-ice, r=jackh726
[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:59:5
3    |
4 LL |     let sp = &mut s;
5    |              ------ mutable borrow occurs here
6 LL |     s(3);
7    |     ^ immutable borrow occurs here
8 LL |     use_mut(sp);
9    |             -- mutable borrow later used here
10
11 error[E0596]: cannot borrow `s` as mutable, as it is not declared as mutable
12   --> $DIR/borrowck-overloaded-call.rs:67:5
13    |
14 LL |     let s = SFnMut {
15    |         - help: consider changing this to be mutable: `mut s`
16 ...
17 LL |     s(3);
18    |     ^ cannot borrow as mutable
19
20 error[E0382]: use of moved value: `s`
21   --> $DIR/borrowck-overloaded-call.rs:75:5
22    |
23 LL |     let s = SFnOnce {
24    |         - move occurs because `s` has type `SFnOnce`, which does not implement the `Copy` trait
25 ...
26 LL |     s(" world".to_string());
27    |     - value moved here
28 LL |     s(" world".to_string());
29    |     ^ value used here after move
30
31 error: aborting due to 3 previous errors
32
33 Some errors have detailed explanations: E0382, E0502, E0596.
34 For more information about an error, try `rustc --explain E0382`.