]>
Commit | Line | Data |
---|---|---|
dc9dc135 XL |
1 | // edition:2018 |
2 | ||
3 | // Test that a feature gate is needed to use `impl Trait` as the | |
4 | // return type of an async. | |
5 | ||
dc9dc135 XL |
6 | trait Trait<'a, 'b> { } |
7 | impl<T> Trait<'_, '_> for T { } | |
8 | ||
9 | async fn async_ret_impl_trait<'a, 'b>(a: &'a u8, b: &'b u8) -> impl Trait<'a, 'b> { | |
10 | //~^ ERROR ambiguous lifetime bound | |
dfeec247 | 11 | //~| ERROR ambiguous lifetime bound |
ba9703b0 XL |
12 | //~| ERROR ambiguous lifetime bound |
13 | //~| ERROR hidden type for `impl Trait` captures lifetime that does not appear in bounds | |
14 | //~| ERROR hidden type for `impl Trait` captures lifetime that does not appear in bounds | |
dc9dc135 XL |
15 | (a, b) |
16 | } | |
17 | ||
18 | fn main() { | |
19 | let _ = async_ret_impl_trait(&22, &44); | |
20 | } |