blob: 5093916e73a45b68aa0672aae38da94b83fc1fbe (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
// edition:2018
//
// Regression test for issue #67765
// Tests that we point at the proper location when giving
// a lifetime error.
fn main() {}
async fn func<'a>() -> Result<(), &'a str> {
let s = String::new();
let b = &s[..];
Err(b)?; //~ ERROR cannot return value referencing local variable `s`
Ok(())
}
|