File tree Expand file tree Collapse file tree 3 files changed +8
-4
lines changed
compiler/rustc_target/src/callconv Expand file tree Collapse file tree 3 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -148,12 +148,12 @@ where
148148 Ty : TyAbiInterface < ' a , C > + Copy ,
149149 C : HasDataLayout ,
150150{
151- if !fn_abi. ret . is_ignore ( ) {
151+ if !fn_abi. ret . is_ignore ( ) && fn_abi . ret . layout . is_sized ( ) {
152152 classify_ret ( cx, & mut fn_abi. ret ) ;
153153 }
154154
155155 for arg in fn_abi. args . iter_mut ( ) {
156- if arg. is_ignore ( ) {
156+ if arg. is_ignore ( ) || !arg . layout . is_sized ( ) {
157157 continue ;
158158 }
159159 classify_arg ( cx, arg) ;
Original file line number Diff line number Diff line change @@ -216,11 +216,14 @@ where
216216 Ty : TyAbiInterface < ' a , C > + Copy ,
217217 C : HasDataLayout + HasTargetSpec ,
218218{
219- if !fn_abi. ret . is_ignore ( ) {
219+ if !fn_abi. ret . is_ignore ( ) && fn_abi . ret . layout . is_sized ( ) {
220220 classify_arg ( cx, & mut fn_abi. ret , Size :: from_bytes ( 32 ) ) ;
221221 }
222222
223223 for arg in fn_abi. args . iter_mut ( ) {
224+ if !arg. layout . is_sized ( ) {
225+ continue ;
226+ }
224227 if arg. is_ignore ( ) {
225228 // sparc64-unknown-linux-{gnu,musl,uclibc} doesn't ignore ZSTs.
226229 if cx. target_spec ( ) . os == Os :: Linux
Original file line number Diff line number Diff line change @@ -280,7 +280,8 @@ macro_rules! test_transparent_unsized {
280280 } ;
281281}
282282
283- #[ cfg( not( any( target_arch = "mips64" , target_arch = "sparc64" ) ) ) ]
283+ // NOTE: non-rustic ABIs do not support unsized types: they are skipped during ABI generation, and
284+ // will trigger an error if they make it to rustc_monomorphize/src/mono_checks/abi_check.rs
284285mod unsized_ {
285286 use super :: * ;
286287 test_transparent_unsized ! ( str_, str ) ;
You can’t perform that action at this time.
0 commit comments