]> git.lizzy.rs Git - rust.git/blob - tests/ui/btreemap/btreemap_dropck.stderr
Auto merge of #107843 - bjorn3:sync_cg_clif-2023-02-09, r=bjorn3
[rust.git] / tests / ui / btreemap / btreemap_dropck.stderr
1 error[E0505]: cannot move out of `s` because it is borrowed
2   --> $DIR/btreemap_dropck.rs:15:10
3    |
4 LL |     let s = String::from("Hello World!");
5    |         - binding `s` declared here
6 LL |     let _map = BTreeMap::from_iter([((), PrintOnDrop(&s))]);
7    |                                                      -- borrow of `s` occurs here
8 LL |     drop(s);
9    |          ^ move out of `s` occurs here
10 LL | }
11    | - borrow might be used here, when `_map` is dropped and runs the `Drop` code for type `BTreeMap`
12
13 error: aborting due to previous error
14
15 For more information about this error, try `rustc --explain E0505`.