2023-11-21 21:43:59 -06:00
|
|
|
//@ revisions: current next
|
2024-03-10 20:18:41 -05:00
|
|
|
//@ ignore-compare-mode-next-solver (explicit revisions)
|
2023-12-14 06:11:28 -06:00
|
|
|
//@[next] compile-flags: -Znext-solver
|
2024-01-10 10:30:07 -06:00
|
|
|
//@[current] check-pass
|
|
|
|
//@[next] known-bug: trait-system-refactor-initiative#82
|
2023-11-21 21:43:59 -06:00
|
|
|
|
|
|
|
#![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 {
|
2024-04-11 08:15:34 -05:00
|
|
|
#[coroutine]
|
2023-11-21 21:43:59 -06:00
|
|
|
move |_: ()| {
|
|
|
|
let () = yield ();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|