blob: 7fe1baef952e1606a4af214f5104aaf79d141048 (
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(())
}
|