2023-11-22 03:43:59 +00:00
|
|
|
// revisions: current next
|
2023-12-14 12:11:28 +00:00
|
|
|
//[next] compile-flags: -Znext-solver
|
2023-11-22 03:43:59 +00:00
|
|
|
// check-pass
|
|
|
|
|
|
|
|
#![feature(coroutines, coroutine_trait, coroutine_clone)]
|
|
|
|
|
|
|
|
// This stalls the goal `{coroutine} <: impl Clone`, since that has a nested goal
|
|
|
|
// of `{coroutine}: Clone`. That is only known if we can compute the generator
|
|
|
|
// witness types, which we don't know until after borrowck. When we later check
|
|
|
|
// the goal for correctness, we want to be able to bind the `impl Clone` opaque.
|
|
|
|
pub fn foo<'a, 'b>() -> impl Clone {
|
|
|
|
move |_: ()| {
|
|
|
|
let () = yield ();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|