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