rust/tests/ui/async-await/issues/issue-62517-1.rs

22 lines
417 B
Rust

// Regression test for #62517. We used to ICE when you had an `async
// fn` with an `impl Trait` return that mentioned a `dyn Bar` with no
// explicit lifetime bound.
//
//@ edition:2018
//@ check-pass
trait FirstTrait {}
trait SecondTrait {
type Item: ?Sized;
}
async fn foo(x: &str) -> impl SecondTrait<Item = dyn FirstTrait> {
}
impl<T> SecondTrait for T {
type Item = dyn FirstTrait;
}
fn main() { }