2020-01-21 13:11:00 -06:00
|
|
|
//@ run-rustfix
|
|
|
|
#![allow(dead_code)]
|
|
|
|
|
|
|
|
struct Foo {
|
|
|
|
v: Vec<u32>,
|
2021-07-28 12:08:39 -05:00
|
|
|
h: std::collections::HashMap<i32, i32>,
|
2020-01-21 13:11:00 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
impl Foo {
|
|
|
|
fn bar(&self) {
|
2024-03-12 22:41:41 -05:00
|
|
|
for _ in &self.v.clone() { //~ ERROR cannot move out of `self.v` which is behind a shared reference
|
2020-01-21 13:11:00 -06:00
|
|
|
}
|
2024-03-12 22:41:41 -05:00
|
|
|
for _ in &self.h.clone() { //~ ERROR cannot move out of `self.h` which is behind a shared reference
|
2021-07-28 12:08:39 -05:00
|
|
|
}
|
2020-01-21 13:11:00 -06:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-08-05 08:41:08 -05:00
|
|
|
const LOADERS: &Vec<&'static u8> = &Vec::new();
|
|
|
|
|
|
|
|
pub fn break_code() -> Option<&'static u8> {
|
2024-03-12 22:41:41 -05:00
|
|
|
for loader in &LOADERS.clone() { //~ ERROR cannot move out of a shared reference
|
2021-08-05 08:41:08 -05:00
|
|
|
return Some(loader);
|
|
|
|
}
|
|
|
|
None
|
|
|
|
}
|
|
|
|
|
2020-01-21 13:11:00 -06:00
|
|
|
fn main() {}
|