]> git.lizzy.rs Git - rust.git/blob - src/test/ui/dropck/drop-with-active-borrows-2.rs
Rollup merge of #105829 - the8472:tidy-style, r=jyn514
[rust.git] / src / test / ui / dropck / drop-with-active-borrows-2.rs
1 fn read_lines_borrowed<'a>() -> Vec<&'a str> {
2     let raw_lines: Vec<String> = vec!["foo  ".to_string(), "  bar".to_string()];
3     raw_lines.iter().map(|l| l.trim()).collect()
4     //~^ ERROR cannot return value referencing local variable `raw_lines`
5 }
6
7 fn main() {
8     println!("{:?}", read_lines_borrowed());
9 }