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