]> git.lizzy.rs Git - rust.git/blob - tests/ui/async-await/issue-67765-async-diagnostic.rs
Rollup merge of #106971 - oli-obk:tait_error, r=davidtwco
[rust.git] / tests / ui / async-await / issue-67765-async-diagnostic.rs
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 }