@@ -24,23 +24,23 @@ use rustc_span::def_id::{CrateNum, DefId, LOCAL_CRATE};
24
24
use rustc_span:: { FileNameDisplayPreference , Span , Symbol } ;
25
25
use rustc_target:: callconv:: FnAbi ;
26
26
27
- use super :: { SmirAllocRange , CompilerCtxt , SmirTy , SmirTypingEnv } ;
27
+ use super :: { AllocRangeHelpers , CompilerCtxt , TyHelpers , TypingEnvHelpers } ;
28
28
use crate :: builder:: BodyBuilder ;
29
29
use crate :: { Bridge , SmirError , Tables , filter_def_ids} ;
30
30
31
- impl < ' tcx , B : Bridge > SmirTy < ' tcx > for CompilerCtxt < ' tcx , B > {
31
+ impl < ' tcx , B : Bridge > TyHelpers < ' tcx > for CompilerCtxt < ' tcx , B > {
32
32
fn new_foreign ( & self , def_id : DefId ) -> ty:: Ty < ' tcx > {
33
33
ty:: Ty :: new_foreign ( self . tcx , def_id)
34
34
}
35
35
}
36
36
37
- impl < ' tcx , B : Bridge > SmirTypingEnv < ' tcx > for CompilerCtxt < ' tcx , B > {
37
+ impl < ' tcx , B : Bridge > TypingEnvHelpers < ' tcx > for CompilerCtxt < ' tcx , B > {
38
38
fn fully_monomorphized ( & self ) -> ty:: TypingEnv < ' tcx > {
39
39
ty:: TypingEnv :: fully_monomorphized ( )
40
40
}
41
41
}
42
42
43
- impl < ' tcx , B : Bridge > SmirAllocRange < ' tcx > for CompilerCtxt < ' tcx , B > {
43
+ impl < ' tcx , B : Bridge > AllocRangeHelpers < ' tcx > for CompilerCtxt < ' tcx , B > {
44
44
fn alloc_range (
45
45
& self ,
46
46
offset : rustc_abi:: Size ,
@@ -426,7 +426,7 @@ impl<'tcx, B: Bridge> CompilerCtxt<'tcx, B> {
426
426
427
427
/// Evaluate constant as a target usize.
428
428
pub fn eval_target_usize ( & self , cnst : MirConst < ' tcx > ) -> Result < u64 , B :: Error > {
429
- use crate :: context:: SmirTypingEnv ;
429
+ use crate :: context:: TypingEnvHelpers ;
430
430
cnst. try_eval_target_usize ( self . tcx , self . fully_monomorphized ( ) )
431
431
. ok_or_else ( || B :: Error :: new ( format ! ( "Const `{cnst:?}` cannot be encoded as u64" ) ) )
432
432
}
0 commit comments