X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Flibrustc%2Fty%2Fstructural_impls.rs;h=0daa567052d5662ec881cad2b4c366f30b6c5ca4;hb=e83776f3ab90556db3004ab01a217fb06cdc8065;hp=cf04d6eac3ae0b608db0fd0168be15138edd7a83;hpb=39edc68c690b2711def27f229ad3d113c55f6354;p=rust.git diff --git a/src/librustc/ty/structural_impls.rs b/src/librustc/ty/structural_impls.rs index cf04d6eac3a..0daa567052d 100644 --- a/src/librustc/ty/structural_impls.rs +++ b/src/librustc/ty/structural_impls.rs @@ -6,7 +6,7 @@ use crate::hir::def::Namespace; use crate::mir::ProjectionKind; use crate::mir::interpret::ConstValue; -use crate::ty::{self, Lift, Ty, TyCtxt, ConstVid, InferConst}; +use crate::ty::{self, Lift, Ty, TyCtxt, InferConst}; use crate::ty::fold::{TypeFoldable, TypeFolder, TypeVisitor}; use crate::ty::print::{FmtPrinter, Printer}; use rustc_data_structures::indexed_vec::{IndexVec, Idx}; @@ -14,7 +14,6 @@ use crate::mir::interpret; use std::fmt; -use std::marker::PhantomData; use std::rc::Rc; impl fmt::Debug for ty::GenericParamDef { @@ -788,16 +787,6 @@ impl<'a, 'tcx> Lift<'tcx> for interpret::GlobalId<'a> { } } -impl<'a, 'tcx> Lift<'tcx> for ConstVid<'a> { - type Lifted = ConstVid<'tcx>; - fn lift_to_tcx<'b, 'gcx>(&self, _: TyCtxt<'b, 'gcx, 'tcx>) -> Option { - Some(ConstVid { - index: self.index, - phantom: PhantomData, - }) - } -} - /////////////////////////////////////////////////////////////////////////// // TypeFoldable implementations. // @@ -1356,7 +1345,7 @@ fn super_fold_with<'gcx: 'tcx, F: TypeFolder<'gcx, 'tcx>>(&self, folder: &mut F) ConstValue::Param(p) => ConstValue::Param(p.fold_with(folder)), ConstValue::Placeholder(p) => ConstValue::Placeholder(p), ConstValue::Scalar(a) => ConstValue::Scalar(a), - ConstValue::Slice(a, b) => ConstValue::Slice(a, b), + ConstValue::Slice { data, start, end } => ConstValue::Slice { data, start, end }, ConstValue::Unevaluated(did, substs) => ConstValue::Unevaluated(did, substs.fold_with(folder)), } @@ -1369,7 +1358,7 @@ fn super_visit_with>(&self, visitor: &mut V) -> bool { ConstValue::Param(p) => p.visit_with(visitor), ConstValue::Placeholder(_) => false, ConstValue::Scalar(_) => false, - ConstValue::Slice(..) => false, + ConstValue::Slice { .. } => false, ConstValue::Unevaluated(_, substs) => substs.visit_with(visitor), } }