@@ -8,7 +8,7 @@ use rustc_apfloat::{
88use rustc_macros:: HashStable ;
99use rustc_target:: abi:: { HasDataLayout , Size , TargetDataLayout } ;
1010
11- use crate :: ty:: { ParamEnv , ScalarInt , Ty , TyCtxt } ;
11+ use crate :: ty:: { Lift , ParamEnv , ScalarInt , Ty , TyCtxt } ;
1212
1313use super :: { AllocId , Allocation , InterpResult , Pointer , PointerArithmetic } ;
1414
@@ -53,8 +53,9 @@ impl From<Scalar> for ConstValue<'tcx> {
5353 }
5454}
5555
56- impl < ' tcx > ConstValue < ' tcx > {
57- pub fn lift < ' lifted > ( self , tcx : TyCtxt < ' lifted > ) -> Option < ConstValue < ' lifted > > {
56+ impl < ' a , ' tcx > Lift < ' tcx > for ConstValue < ' a > {
57+ type Lifted = ConstValue < ' tcx > ;
58+ fn lift_to_tcx ( self , tcx : TyCtxt < ' tcx > ) -> Option < ConstValue < ' tcx > > {
5859 Some ( match self {
5960 ConstValue :: Scalar ( s) => ConstValue :: Scalar ( s) ,
6061 ConstValue :: Slice { data, start, end } => {
@@ -65,7 +66,9 @@ impl<'tcx> ConstValue<'tcx> {
6566 }
6667 } )
6768 }
69+ }
6870
71+ impl < ' tcx > ConstValue < ' tcx > {
6972 #[ inline]
7073 pub fn try_to_scalar ( & self ) -> Option < Scalar > {
7174 match * self {
0 commit comments