File tree Expand file tree Collapse file tree
rustc_target/src/callconv Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -500,6 +500,7 @@ impl<Cx: HasDataLayout> LayoutCalculator<Cx> {
500500 return Err ( LayoutCalculatorError :: EmptyUnion ) ;
501501 } ;
502502
503+ // We also need to check for a `repr(transparent)` wrapper around `repr(C)`
503504 let repr_c =
504505 repr. c ( ) || ( repr. transparent ( ) && only_variant. iter ( ) . any ( |field| field. repr_c ) ) ;
505506
@@ -1489,6 +1490,7 @@ impl<Cx: HasDataLayout> LayoutCalculator<Cx> {
14891490 unadjusted_abi_align
14901491 } ;
14911492
1493+ // We also need to check for a `repr(transparent)` wrapper around `repr(C)`
14921494 let repr_c = repr. c ( ) || ( repr. transparent ( ) && fields. iter ( ) . any ( |field| field. repr_c ) ) ;
14931495
14941496 let seed = field_seed. wrapping_add ( repr. field_shuffle_seed ) ;
Original file line number Diff line number Diff line change 4949 } ;
5050
5151 // Windows ABIs do not talk about ZST since such types do not exist in MSVC.
52- // However, clang and gcc allow ZST is their windows-gnu targets, and pass them by pointer indierction .
52+ // However, clang and gcc allow ZST in their windows-gnu targets, and pass them by pointer indirection .
5353 // We follow that for `repr(C)` ZSTs (and `repr(transparent)` wrappers around them),
5454 // but `repr(Rust)` ones are always ignored (ensuring that `()` matches C `void`).
5555
Original file line number Diff line number Diff line change @@ -138,7 +138,7 @@ extern "sysv64" fn ret_c_maybezst_sysv64() -> CMaybeZst {
138138 CMaybeZst
139139}
140140
141- // For `extern "C"` functions, ZST are ignored on Linux put reted on Windows.
141+ // For `extern "C"` functions, ZST are ignored on Linux but returned via pointer on Windows.
142142
143143// linux: define void @ret_c_maybezst_c()
144144// windows-msvc: define void @ret_c_maybezst_c(ptr {{[^,]*}})
You can’t perform that action at this time.
0 commit comments