// explicit lifetime bound.
//
// edition:2018
+// check-pass
#![feature(async_await)]
trait Object {}
-trait Alpha<Param> {}
+trait Alpha<Param: ?Sized> {}
async fn foo<'a>(_: &'a ()) -> impl Alpha<dyn Object> {}
-//~^ ERROR not satisfied
+
+impl<T> Alpha<dyn Object> for T { }
fn main() { }
+++ /dev/null
-error[E0277]: the trait bound `(): Alpha<(dyn Object + 'static)>` is not satisfied
- --> $DIR/issue-62517-2.rs:13:32
- |
-LL | async fn foo<'a>(_: &'a ()) -> impl Alpha<dyn Object> {}
- | ^^^^^^^^^^^^^^^^^^^^^^ the trait `Alpha<(dyn Object + 'static)>` is not implemented for `()`
- |
- = note: the return type of a function must have a statically known size
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0277`.