1
+ use rustc_abi:: TyAbiInterface ;
2
+
1
3
use crate :: callconv:: { ArgAbi , FnAbi } ;
2
4
use crate :: spec:: HasTargetSpec ;
3
5
@@ -9,7 +11,10 @@ fn classify_ret<Ty>(ret: &mut ArgAbi<'_, Ty>) {
9
11
}
10
12
}
11
13
12
- fn classify_arg < Ty > ( cx : & impl HasTargetSpec , arg : & mut ArgAbi < ' _ , Ty > ) {
14
+ fn classify_arg < ' a , Ty , C > ( cx : & impl HasTargetSpec , arg : & mut ArgAbi < ' a , Ty > )
15
+ where
16
+ Ty : TyAbiInterface < ' a , C > + Copy ,
17
+ {
13
18
if arg. is_ignore ( ) {
14
19
// powerpc-unknown-linux-{gnu,musl,uclibc} doesn't ignore ZSTs.
15
20
if cx. target_spec ( ) . os == "linux"
@@ -20,14 +25,19 @@ fn classify_arg<Ty>(cx: &impl HasTargetSpec, arg: &mut ArgAbi<'_, Ty>) {
20
25
}
21
26
return ;
22
27
}
23
- if arg. layout . is_aggregate ( ) {
28
+ // `is_pass_indirectly` is only `true` for `VaList` which is already an aggregate, so the
29
+ // `.is_pass_indirectly()` call is just to make it explicit that this case is handled.
30
+ if arg. layout . is_aggregate ( ) || arg. layout . is_pass_indirectly ( ) {
24
31
arg. make_indirect ( ) ;
25
32
} else {
26
33
arg. extend_integer_width_to ( 32 ) ;
27
34
}
28
35
}
29
36
30
- pub ( crate ) fn compute_abi_info < Ty > ( cx : & impl HasTargetSpec , fn_abi : & mut FnAbi < ' _ , Ty > ) {
37
+ pub ( crate ) fn compute_abi_info < ' a , Ty , C > ( cx : & impl HasTargetSpec , fn_abi : & mut FnAbi < ' a , Ty > )
38
+ where
39
+ Ty : TyAbiInterface < ' a , C > + Copy ,
40
+ {
31
41
if !fn_abi. ret . is_ignore ( ) {
32
42
classify_ret ( & mut fn_abi. ret ) ;
33
43
}
0 commit comments