struct MirNeighborCollector<'a, 'tcx: 'a> {
tcx: TyCtxt<'a, 'tcx, 'tcx>,
- mir: &'a mir::Mir<'tcx>,
+ mir: &'a mir::Body<'tcx>,
output: &'a mut Vec<MonoItem<'tcx>>,
param_substs: SubstsRef<'tcx>,
}
fn visit_const(&mut self, constant: &&'tcx ty::Const<'tcx>, location: Location) {
debug!("visiting const {:?} @ {:?}", *constant, location);
- collect_const(self.tcx, **constant, self.param_substs, self.output);
+ collect_const(self.tcx, *constant, self.param_substs, self.output);
self.super_const(constant);
}
mir: &mir,
output,
param_substs: instance.substs,
- }.visit_mir(&mir);
+ }.visit_body(&mir);
let param_env = ty::ParamEnv::reveal_all();
for i in 0..mir.promoted.len() {
use rustc_data_structures::indexed_vec::Idx;
fn collect_const<'a, 'tcx>(
tcx: TyCtxt<'a, 'tcx, 'tcx>,
- constant: ty::Const<'tcx>,
+ constant: &'tcx ty::Const<'tcx>,
param_substs: SubstsRef<'tcx>,
output: &mut Vec<MonoItem<'tcx>>,
) {
debug!("visiting const {:?}", constant);
match constant.val {
- ConstValue::Slice(Scalar::Ptr(ptr), _) |
ConstValue::Scalar(Scalar::Ptr(ptr)) =>
collect_miri(tcx, ptr.alloc_id, output),
- ConstValue::ByRef(_ptr, alloc) => {
+ ConstValue::Slice { data: alloc, start: _, end: _ } |
+ ConstValue::ByRef(_, alloc) => {
for &((), id) in alloc.relocations.values() {
collect_miri(tcx, id, output);
}