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