s/Generator/Coroutine/
This commit is contained in:
parent
96027d945b
commit
60956837cf
310 changed files with 1271 additions and 1271 deletions
|
@ -4,7 +4,7 @@ use rustc_hir::lang_items::LangItem;
|
|||
use rustc_middle::mir::*;
|
||||
use rustc_middle::query::Providers;
|
||||
use rustc_middle::ty::GenericArgs;
|
||||
use rustc_middle::ty::{self, EarlyBinder, GeneratorArgs, Ty, TyCtxt};
|
||||
use rustc_middle::ty::{self, CoroutineArgs, EarlyBinder, Ty, TyCtxt};
|
||||
use rustc_target::abi::{FieldIdx, VariantIdx, FIRST_VARIANT};
|
||||
|
||||
use rustc_index::{Idx, IndexVec};
|
||||
|
@ -69,7 +69,7 @@ fn make_shim<'tcx>(tcx: TyCtxt<'tcx>, instance: ty::InstanceDef<'tcx>) -> Body<'
|
|||
ty::InstanceDef::DropGlue(def_id, ty) => {
|
||||
// FIXME(#91576): Drop shims for generators aren't subject to the MIR passes at the end
|
||||
// of this function. Is this intentional?
|
||||
if let Some(ty::Generator(gen_def_id, args, _)) = ty.map(Ty::kind) {
|
||||
if let Some(ty::Coroutine(gen_def_id, args, _)) = ty.map(Ty::kind) {
|
||||
let body = tcx.optimized_mir(*gen_def_id).generator_drop().unwrap();
|
||||
let mut body = EarlyBinder::bind(body.clone()).instantiate(tcx, args);
|
||||
debug!("make_shim({:?}) = {:?}", instance, body);
|
||||
|
@ -392,7 +392,7 @@ fn build_clone_shim<'tcx>(tcx: TyCtxt<'tcx>, def_id: DefId, self_ty: Ty<'tcx>) -
|
|||
_ if is_copy => builder.copy_shim(),
|
||||
ty::Closure(_, args) => builder.tuple_like_shim(dest, src, args.as_closure().upvar_tys()),
|
||||
ty::Tuple(..) => builder.tuple_like_shim(dest, src, self_ty.tuple_fields()),
|
||||
ty::Generator(gen_def_id, args, hir::Movability::Movable) => {
|
||||
ty::Coroutine(gen_def_id, args, hir::Movability::Movable) => {
|
||||
builder.generator_shim(dest, src, *gen_def_id, args.as_generator())
|
||||
}
|
||||
_ => bug!("clone shim for `{:?}` which is not `Copy` and is not an aggregate", self_ty),
|
||||
|
@ -598,7 +598,7 @@ impl<'tcx> CloneShimBuilder<'tcx> {
|
|||
dest: Place<'tcx>,
|
||||
src: Place<'tcx>,
|
||||
gen_def_id: DefId,
|
||||
args: GeneratorArgs<'tcx>,
|
||||
args: CoroutineArgs<'tcx>,
|
||||
) {
|
||||
self.block(vec![], TerminatorKind::Goto { target: self.block_index_offset(3) }, false);
|
||||
let unwind = self.block(vec![], TerminatorKind::UnwindResume, true);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue