]> git.lizzy.rs Git - rust.git/blob - tests/ui/dropck/drop-with-active-borrows-1.rs
Rollup merge of #106797 - FawazTirmizi:dev/issues/104284, r=bjorn3
[rust.git] / tests / ui / dropck / drop-with-active-borrows-1.rs
1 fn main() {
2     let a = "".to_string();
3     let b: Vec<&str> = a.lines().collect();
4     drop(a);    //~ ERROR cannot move out of `a` because it is borrowed
5     for s in &b {
6         println!("{}", *s);
7     }
8 }