-
Notifications
You must be signed in to change notification settings - Fork 12.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow defining opaques in check_coroutine_obligations
- Loading branch information
1 parent
ed10a53
commit 4f958a4
Showing
3 changed files
with
36 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// revisions: current next | ||
//[next] compile-flags: -Ztrait-solver=next | ||
// 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() {} |