@@ -8,7 +8,7 @@ use rustc_apfloat::{
8
8
use rustc_macros:: HashStable ;
9
9
use rustc_target:: abi:: { HasDataLayout , Size , TargetDataLayout } ;
10
10
11
- use crate :: ty:: { ParamEnv , ScalarInt , Ty , TyCtxt } ;
11
+ use crate :: ty:: { Lift , ParamEnv , ScalarInt , Ty , TyCtxt } ;
12
12
13
13
use super :: { AllocId , Allocation , InterpResult , Pointer , PointerArithmetic } ;
14
14
@@ -53,8 +53,9 @@ impl From<Scalar> for ConstValue<'tcx> {
53
53
}
54
54
}
55
55
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 > > {
58
59
Some ( match self {
59
60
ConstValue :: Scalar ( s) => ConstValue :: Scalar ( s) ,
60
61
ConstValue :: Slice { data, start, end } => {
@@ -65,7 +66,9 @@ impl<'tcx> ConstValue<'tcx> {
65
66
}
66
67
} )
67
68
}
69
+ }
68
70
71
+ impl < ' tcx > ConstValue < ' tcx > {
69
72
#[ inline]
70
73
pub fn try_to_scalar ( & self ) -> Option < Scalar > {
71
74
match * self {
0 commit comments