X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Flibrustc_mir%2Fdataflow%2Fmove_paths%2Fabs_domain.rs;h=1255209322b0ee4245384f21138bb5cb9e5d8c47;hb=e268ddf52d7b52b0633572dacdf628c17978f1df;hp=5e61c2ec7a292b588a727f33d05c560b74339dcd;hpb=0565653eecd7d667dbb28bb5d3008e783950892a;p=rust.git diff --git a/src/librustc_mir/dataflow/move_paths/abs_domain.rs b/src/librustc_mir/dataflow/move_paths/abs_domain.rs index 5e61c2ec7a2..1255209322b 100644 --- a/src/librustc_mir/dataflow/move_paths/abs_domain.rs +++ b/src/librustc_mir/dataflow/move_paths/abs_domain.rs @@ -23,11 +23,14 @@ use rustc::mir::LvalueElem; use rustc::mir::{Operand, ProjectionElem}; +use rustc::ty::Ty; #[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)] pub struct AbstractOperand; +#[derive(Copy, Clone, PartialEq, Eq, Hash, Debug)] +pub struct AbstractType; pub type AbstractElem<'tcx> = - ProjectionElem<'tcx, AbstractOperand>; + ProjectionElem<'tcx, AbstractOperand, AbstractType>; pub trait Lift { type Abstract; @@ -37,6 +40,10 @@ impl<'tcx> Lift for Operand<'tcx> { type Abstract = AbstractOperand; fn lift(&self) -> Self::Abstract { AbstractOperand } } +impl<'tcx> Lift for Ty<'tcx> { + type Abstract = AbstractType; + fn lift(&self) -> Self::Abstract { AbstractType } +} impl<'tcx> Lift for LvalueElem<'tcx> { type Abstract = AbstractElem<'tcx>; fn lift(&self) -> Self::Abstract { @@ -44,7 +51,7 @@ fn lift(&self) -> Self::Abstract { ProjectionElem::Deref => ProjectionElem::Deref, ProjectionElem::Field(ref f, ty) => - ProjectionElem::Field(f.clone(), ty.clone()), + ProjectionElem::Field(f.clone(), ty.lift()), ProjectionElem::Index(ref i) => ProjectionElem::Index(i.lift()), ProjectionElem::Subslice {from, to} =>