Handle case of moving into vec with uninferred lifetime
This commit is contained in:
parent
2c5f2df201
commit
1a1afd74a6
2 changed files with 19 additions and 8 deletions
|
|
@ -25,9 +25,12 @@ impl CrateId {
|
|||
|
||||
pub fn remove_package_from_database() {
|
||||
let mut lines_to_use: Vec<&CrateId> = Vec::new();
|
||||
//~^ ERROR borrowed data cannot be moved outside of its closure
|
||||
//~^ NOTE cannot infer an appropriate lifetime
|
||||
let push_id = |installed_id: &CrateId| {
|
||||
//~^ NOTE borrowed data cannot outlive this closure
|
||||
lines_to_use.push(installed_id);
|
||||
//~^ ERROR borrowed data cannot be moved outside of its closure
|
||||
//~| NOTE cannot be moved outside of its closure
|
||||
};
|
||||
list_database(push_id);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue