X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Flibrustc_mir%2Finterpret%2Fvalidity.rs;h=8a8cc0fe1d174a3c2da6ad8fb569d53af91a5b24;hb=fff08cb04389497d254fb40948674cbbee402908;hp=21704bf66e8d26ba07c734d1282bb21d5b3162ca;hpb=97df8676b7fb856e396057b8ecfc231489456b10;p=rust.git diff --git a/src/librustc_mir/interpret/validity.rs b/src/librustc_mir/interpret/validity.rs index 21704bf66e8..8a8cc0fe1d1 100644 --- a/src/librustc_mir/interpret/validity.rs +++ b/src/librustc_mir/interpret/validity.rs @@ -81,7 +81,7 @@ pub struct RefTracking { pub todo: Vec<(T, Vec)>, } -impl<'tcx, T: Copy + Eq + Hash> RefTracking { +impl RefTracking { pub fn new(op: T) -> Self { let mut ref_tracking = RefTracking { seen: FxHashSet::default(), @@ -149,17 +149,17 @@ fn wrapping_range_format(r: &RangeInclusive, max_hi: u128) -> String { } } -struct ValidityVisitor<'rt, 'a: 'rt, 'mir: 'rt, 'tcx: 'a+'rt+'mir, M: Machine<'a, 'mir, 'tcx>+'rt> { +struct ValidityVisitor<'rt, 'mir, 'tcx, M: Machine<'mir, 'tcx>> { /// The `path` may be pushed to, but the part that is present when a function /// starts must not be changed! `visit_fields` and `visit_array` rely on /// this stack discipline. path: Vec, ref_tracking: Option<&'rt mut RefTracking>>, const_mode: bool, - ecx: &'rt InterpretCx<'a, 'mir, 'tcx, M>, + ecx: &'rt InterpretCx<'mir, 'tcx, M>, } -impl<'rt, 'a, 'mir, 'tcx, M: Machine<'a, 'mir, 'tcx>> ValidityVisitor<'rt, 'a, 'mir, 'tcx, M> { +impl<'rt, 'mir, 'tcx, M: Machine<'mir, 'tcx>> ValidityVisitor<'rt, 'mir, 'tcx, M> { fn aggregate_field_path_elem( &mut self, layout: TyLayout<'tcx>, @@ -235,13 +235,13 @@ fn visit_elem( } } -impl<'rt, 'a, 'mir, 'tcx, M: Machine<'a, 'mir, 'tcx>> - ValueVisitor<'a, 'mir, 'tcx, M> for ValidityVisitor<'rt, 'a, 'mir, 'tcx, M> +impl<'rt, 'mir, 'tcx, M: Machine<'mir, 'tcx>> ValueVisitor<'mir, 'tcx, M> + for ValidityVisitor<'rt, 'mir, 'tcx, M> { type V = OpTy<'tcx, M::PointerTag>; #[inline(always)] - fn ecx(&self) -> &InterpretCx<'a, 'mir, 'tcx, M> { + fn ecx(&self) -> &InterpretCx<'mir, 'tcx, M> { &self.ecx } @@ -607,7 +607,7 @@ fn visit_aggregate( } } -impl<'a, 'mir, 'tcx, M: Machine<'a, 'mir, 'tcx>> InterpretCx<'a, 'mir, 'tcx, M> { +impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> InterpretCx<'mir, 'tcx, M> { /// This function checks the data at `op`. `op` is assumed to cover valid memory if it /// is an indirect operand. /// It will error if the bits at the destination do not match the ones described by the layout.