@@ -18,9 +18,6 @@ pub(crate) fn validate_cmse_abi<'tcx>(
18
18
abi : abi:: Abi ,
19
19
fn_sig : ty:: PolyFnSig < ' tcx > ,
20
20
) {
21
- // this type is only used for layout computation, which does not rely on regions
22
- let fn_sig = tcx. instantiate_bound_regions_with_erased ( fn_sig) ;
23
-
24
21
if let abi:: Abi :: CCmseNonSecureCall = abi {
25
22
let hir_node = tcx. hir_node ( hir_id) ;
26
23
let hir:: Node :: Ty ( hir:: Ty {
@@ -70,11 +67,14 @@ pub(crate) fn validate_cmse_abi<'tcx>(
70
67
/// Returns whether the inputs will fit into the available registers
71
68
fn is_valid_cmse_inputs < ' tcx > (
72
69
tcx : TyCtxt < ' tcx > ,
73
- fn_sig : ty:: FnSig < ' tcx > ,
70
+ fn_sig : ty:: PolyFnSig < ' tcx > ,
74
71
) -> Result < Result < ( ) , usize > , & ' tcx LayoutError < ' tcx > > {
75
72
let mut span = None ;
76
73
let mut accum = 0u64 ;
77
74
75
+ // this type is only used for layout computation, which does not rely on regions
76
+ let fn_sig = tcx. instantiate_bound_regions_with_erased ( fn_sig) ;
77
+
78
78
for ( index, ty) in fn_sig. inputs ( ) . iter ( ) . enumerate ( ) {
79
79
let layout = tcx. layout_of ( ParamEnv :: reveal_all ( ) . and ( * ty) ) ?;
80
80
@@ -99,8 +99,11 @@ fn is_valid_cmse_inputs<'tcx>(
99
99
/// Returns whether the output will fit into the available registers
100
100
fn is_valid_cmse_output < ' tcx > (
101
101
tcx : TyCtxt < ' tcx > ,
102
- fn_sig : ty:: FnSig < ' tcx > ,
102
+ fn_sig : ty:: PolyFnSig < ' tcx > ,
103
103
) -> Result < bool , & ' tcx LayoutError < ' tcx > > {
104
+ // this type is only used for layout computation, which does not rely on regions
105
+ let fn_sig = tcx. instantiate_bound_regions_with_erased ( fn_sig) ;
106
+
104
107
let mut ret_ty = fn_sig. output ( ) ;
105
108
let layout = tcx. layout_of ( ParamEnv :: reveal_all ( ) . and ( ret_ty) ) ?;
106
109
let size = layout. layout . size ( ) . bytes ( ) ;
0 commit comments