mirror of
https://github.com/rust-lang/rust.git
synced 2025-10-02 10:18:25 +00:00
12 lines
358 B
Rust
12 lines
358 B
Rust
//! Regression test for https://github.com/rust-lang/rust/issues/13497
|
|
|
|
fn read_lines_borrowed<'a>() -> Vec<&'a str> {
|
|
let rawLines: Vec<String> = vec!["foo ".to_string(), " bar".to_string()];
|
|
rawLines //~ ERROR cannot return value referencing local variable `rawLines`
|
|
.iter()
|
|
.map(|l| l.trim())
|
|
.collect()
|
|
}
|
|
|
|
fn main() {}
|