]> git.lizzy.rs Git - rust.git/blob - src/test/ui/async-await/issues/issue-62517-1.rs
Add 'compiler/rustc_codegen_gcc/' from commit 'afae271d5d3719eeb92c18bc004bb6d1965a5f3f'
[rust.git] / src / test / ui / async-await / issues / issue-62517-1.rs
1 // Regression test for #62517. We used to ICE when you had an `async
2 // fn` with an `impl Trait` return that mentioned a `dyn Bar` with no
3 // explicit lifetime bound.
4 //
5 // edition:2018
6 // check-pass
7
8 trait FirstTrait {}
9 trait SecondTrait {
10     type Item: ?Sized;
11 }
12
13 async fn foo(x: &str) -> impl SecondTrait<Item = dyn FirstTrait> {
14 }
15
16
17 impl<T> SecondTrait for T {
18     type Item = dyn FirstTrait;
19 }
20
21 fn main() { }