More comments, final tweaks
This commit is contained in:
parent
37184e86ea
commit
c98d6994a3
20 changed files with 169 additions and 42 deletions
|
@ -646,9 +646,16 @@ impl<'tcx> Instance<'tcx> {
|
|||
bug!()
|
||||
};
|
||||
|
||||
// If the closure's kind ty disagrees with the identity closure's kind ty,
|
||||
// then this must be a coroutine generated by one of the `ConstructCoroutineInClosureShim`s.
|
||||
if args.as_coroutine().kind_ty() == id_args.as_coroutine().kind_ty() {
|
||||
Some(Instance { def: ty::InstanceDef::Item(coroutine_def_id), args })
|
||||
} else {
|
||||
assert_eq!(
|
||||
args.as_coroutine().kind_ty().to_opt_closure_kind().unwrap(),
|
||||
ty::ClosureKind::FnOnce,
|
||||
"FIXME(async_closures): Generate a by-mut body here."
|
||||
);
|
||||
Some(Instance {
|
||||
def: ty::InstanceDef::CoroutineByMoveShim { coroutine_def_id },
|
||||
args,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue