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) {
|
|
|
|
for _ in &self.v { //~ ERROR cannot move out of `self.v` which is behind a shared reference
|
|
|
|
}
|
2021-07-28 17:08:39 +00:00
|
|
|
for _ in &self.h { //~ ERROR cannot move out of `self.h` which is behind a shared reference
|
|
|
|
}
|
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> {
|
|
|
|
for loader in &*LOADERS { //~ ERROR cannot move out of a shared reference
|
|
|
|
return Some(loader);
|
|
|
|
}
|
|
|
|
None
|
|
|
|
}
|
|
|
|
|
2020-01-21 19:11:00 +00:00
|
|
|
fn main() {}
|