rust/tests/ui/borrowck/copy-suggestion-region-vid.fixed

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

19 lines
378 B
Rust
Raw Normal View History

//@ run-rustfix
pub struct DataStruct();
pub struct HelperStruct<'n> {
pub helpers: [Vec<&'n i64>; 2],
pub is_empty: bool,
}
impl DataStruct {
pub fn f(&self) -> HelperStruct {
let helpers = [vec![], vec![]];
HelperStruct { helpers: helpers.clone(), is_empty: helpers[0].is_empty() }
//~^ ERROR borrow of moved value
}
}
fn main() {}