]> git.lizzy.rs Git - rust.git/blob - src/test/ui/borrowck/borrowck-overloaded-index-move-index.nll.stderr
Unit test from #57866.
[rust.git] / src / test / ui / borrowck / borrowck-overloaded-index-move-index.nll.stderr
1 error[E0505]: cannot move out of `s` because it is borrowed
2   --> $DIR/borrowck-overloaded-index-move-index.rs:50:22
3    |
4 LL |     let rs = &mut s;
5    |              ------ borrow of `s` occurs here
6 LL | 
7 LL |     println!("{}", f[s]);
8    |                      ^ move out of `s` occurs here
9 ...
10 LL |     use_mut(rs);
11    |             -- borrow later used here
12
13 error[E0505]: cannot move out of `s` because it is borrowed
14   --> $DIR/borrowck-overloaded-index-move-index.rs:53:7
15    |
16 LL |     let rs = &mut s;
17    |              ------ borrow of `s` occurs here
18 ...
19 LL |     f[s] = 10;
20    |       ^ move out of `s` occurs here
21 ...
22 LL |     use_mut(rs);
23    |             -- borrow later used here
24
25 error[E0382]: use of moved value: `s`
26   --> $DIR/borrowck-overloaded-index-move-index.rs:53:7
27    |
28 LL |     println!("{}", f[s]);
29    |                      - value moved here
30 ...
31 LL |     f[s] = 10;
32    |       ^ value used here after move
33    |
34    = note: move occurs because `s` has type `std::string::String`, which does not implement the `Copy` trait
35
36 error: aborting due to 3 previous errors
37
38 Some errors occurred: E0382, E0505.
39 For more information about an error, try `rustc --explain E0382`.