rust/tests/ui/borrowck/issue-82032.rs

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

17 lines
308 B
Rust
Raw Normal View History

2021-02-13 05:12:57 -06:00
use std::{fs, io::*};
use std::collections::HashMap;
type Handle = BufWriter<fs::File>;
struct Thing(HashMap<String, Handle>);
impl Thing {
pub fn die_horribly(&mut self) {
for v in self.0.values() {
v.flush();
//~^ ERROR cannot borrow
}
}
}
fn main() {}