ty::Array(ty, ..) | ty::Slice(ty) =>
may_have_reference(ty, tcx),
ty::Tuple(tys) =>
- tys.iter().any(|ty| may_have_reference(ty, tcx)),
+ tys.iter().any(|ty| may_have_reference(ty.expect_ty(), tcx)),
ty::Adt(adt, substs) =>
adt.variants.iter().any(|v| v.fields.iter().any(|f|
may_have_reference(f.ty(tcx, substs), tcx)
fn run_pass<'a, 'tcx>(&self,
tcx: TyCtxt<'a, 'tcx, 'tcx>,
_src: MirSource<'tcx>,
- mir: &mut Mir<'tcx>)
+ mir: &mut Body<'tcx>)
{
if !tcx.sess.opts.debugging_opts.mir_emit_retag {
return;
if src_ty.is_region_ptr() {
// The only `Misc` casts on references are those creating raw pointers.
assert!(dest_ty.is_unsafe_ptr());
- (RetagKind::Raw, place)
+ (RetagKind::Raw, place.clone())
} else {
// Some other cast, no retag
continue
_ =>
RetagKind::Default,
};
- (kind, place)
+ (kind, place.clone())
}
// Do nothing for the rest
_ => continue,
let source_info = block_data.statements[i].source_info;
block_data.statements.insert(i+1, Statement {
source_info,
- kind: StatementKind::Retag(retag_kind, place.clone()),
+ kind: StatementKind::Retag(retag_kind, place),
});
}
}