File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -131,9 +131,12 @@ extern "C" fn foo(x: __m256) -> __m256;
131131
132132fn main () {
133133 unsafe {
134- union U { v : __m256 , a : [u64 ; 4 ] }
134+ #[repr( C )] union U { v : __m256 , a : [u64 ; 4 ] }
135135 if is_x86_feature_detected! (" avx" ) {
136- foo (U { a : [0 ; 4 ] }. v);
136+ // note: this operation is used here for readability
137+ // but its behavior is currently unspecified (see note above).
138+ let vec = U { a : [0 ; 4 ] }. v;
139+ foo (vec );
137140 }
138141 }
139142}
@@ -212,5 +215,5 @@ target features are enabled at compile-time.
212215
213216* Should it be possible to use, e.g., ` __m128 ` on C FFI when the ` avx ` feature
214217 is enabled? Does that change the calling convention and make doing so unsafe ?
215- We could extern this RFC to also require that to use certain types certain
218+ We could extend this RFC to also require that to use certain types certain
216219 features must be disabled.
You can’t perform that action at this time.
0 commit comments