]> git.lizzy.rs Git - rust.git/blob - src/test/ui/async-await/issues/issue-64433.rs
Rollup merge of #103766 - lukas-code:error-in-core, r=Dylan-DPC
[rust.git] / src / test / ui / async-await / issues / issue-64433.rs
1 // Regression test for issue #64433.
2 //
3 // See issue-64391-2.rs for more details, as that was fixed by the
4 // same PR.
5 //
6 // check-pass
7 // edition:2018
8
9 #[derive(Debug)]
10 struct A<'a> {
11     inner: Vec<&'a str>,
12 }
13
14 struct B {}
15
16 impl B {
17     async fn something_with_a(&mut self, a: A<'_>) -> Result<(), String> {
18         println!("{:?}", a);
19         Ok(())
20     }
21 }
22
23 async fn can_error(some_string: &str) -> Result<(), String> {
24     let a = A { inner: vec![some_string, "foo"] };
25     let mut b = B {};
26     Ok(b.something_with_a(a).await.map(drop)?)
27 }
28
29 fn main() {
30 }