]> git.proxmox.com Git - rustc.git/blame - src/test/ui/async-await/multiple-lifetimes/ret-impl-trait-no-fg.rs
New upstream version 1.44.1+dfsg1
[rustc.git] / src / test / ui / async-await / multiple-lifetimes / ret-impl-trait-no-fg.rs
CommitLineData
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
6trait Trait<'a, 'b> { }
7impl<T> Trait<'_, '_> for T { }
8
9async 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
18fn main() {
19 let _ = async_ret_impl_trait(&22, &44);
20}