use middle::const_val::ConstVal;
use hir::def_id::DefId;
use ty::subst::Substs;
-use ty::{ClosureSubsts, FnOutput, Region, Ty};
+use ty::{ClosureSubsts, Region, Ty};
use mir::repr::*;
use rustc_const_math::ConstUsize;
use rustc_data_structures::tuple_slice::TupleSlice;
//
// For the most part, we do not destructure things external to the
// MIR, e.g. types, spans, etc, but simply visit them and stop. This
-// avoids duplication with other visitors like `TypeFoldable`. But
-// there is one exception: we do destructure the `FnOutput` to reach
-// the type within. Just because.
+// avoids duplication with other visitors like `TypeFoldable`.
//
// ## Updating
//
self.super_source_info(source_info);
}
- fn visit_fn_output(&mut self,
- fn_output: & $($mutability)* FnOutput<'tcx>) {
- self.super_fn_output(fn_output);
- }
-
fn visit_ty(&mut self,
ty: & $($mutability)* Ty<'tcx>) {
self.super_ty(ty);
self.visit_visibility_scope_data(scope);
}
- self.visit_fn_output(&$($mutability)* mir.return_ty);
+ self.visit_ty(&$($mutability)* mir.return_ty);
for var_decl in &$($mutability)* mir.var_decls {
self.visit_var_decl(var_decl);
ref $($mutability)* rvalue) => {
self.visit_assign(block, lvalue, rvalue);
}
+ StatementKind::SetDiscriminant{ ref $($mutability)* lvalue, .. } => {
+ self.visit_lvalue(lvalue, LvalueContext::Store);
+ }
+ StatementKind::StorageLive(ref $($mutability)* lvalue) => {
+ self.visit_lvalue(lvalue, LvalueContext::StorageLive);
+ }
+ StatementKind::StorageDead(ref $($mutability)* lvalue) => {
+ self.visit_lvalue(lvalue, LvalueContext::StorageDead);
+ }
}
}
self.visit_visibility_scope(scope);
}
- fn super_fn_output(&mut self, fn_output: & $($mutability)* FnOutput<'tcx>) {
- match *fn_output {
- FnOutput::FnConverging(ref $($mutability)* ty) => {
- self.visit_ty(ty);
- }
- FnOutput::FnDiverging => {
- }
- }
- }
-
fn super_ty(&mut self, _ty: & $($mutability)* Ty<'tcx>) {
}
// Consumed as part of an operand
Consume,
+
+ // Starting and ending a storage live range
+ StorageLive,
+ StorageDead,
}