LocalDecl {
mutability, ty, name: None,
source_info: SourceInfo { scope: ARGUMENT_VISIBILITY_SCOPE, span },
+ internal: false,
is_user_variable: false
}
}
{
debug!("build_drop_shim(def_id={:?}, ty={:?})", def_id, ty);
+ // Check if this is a generator, if so, return the drop glue for it
+ if let Some(&ty::TyS { sty: ty::TyGenerator(gen_def_id, substs, _), .. }) = ty {
+ let mir = &**tcx.optimized_mir(gen_def_id).generator_drop.as_ref().unwrap();
+ return mir.subst(tcx, substs.substs);
+ }
+
let substs = if let Some(ty) = ty {
tcx.mk_substs(iter::once(Kind::from(ty)))
} else {
),
IndexVec::new(),
sig.output(),
+ None,
local_decls_for_sig(&sig, span),
sig.inputs().len(),
vec![],
}
pub struct DropShimElaborator<'a, 'tcx: 'a> {
- mir: &'a Mir<'tcx>,
- patch: MirPatch<'tcx>,
- tcx: ty::TyCtxt<'a, 'tcx, 'tcx>,
- param_env: ty::ParamEnv<'tcx>,
+ pub mir: &'a Mir<'tcx>,
+ pub patch: MirPatch<'tcx>,
+ pub tcx: ty::TyCtxt<'a, 'tcx, 'tcx>,
+ pub param_env: ty::ParamEnv<'tcx>,
}
impl<'a, 'tcx> fmt::Debug for DropShimElaborator<'a, 'tcx> {
),
IndexVec::new(),
sig.output(),
+ None,
local_decls,
sig.inputs().len(),
vec![],
),
IndexVec::new(),
sig.output(),
+ None,
local_decls,
sig.inputs().len(),
vec![],