Skip to content

Commit c6d836d

Browse files
committed
clarify function pointers
1 parent 9466d26 commit c6d836d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

text/3838-scalable-vectors.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,13 @@ Therefore, there is an additional restriction that these types cannot be used in
300300
the argument or return types of functions unless those functions are annotated
301301
with the relevant target feature.
302302

303+
It is permitted to create pointers to function that have scalable vector types
304+
in their arguments or return types, even though function pointers themselves
305+
cannot be annotated as having the target feature. When the function pointer was
306+
created, the user must have made the unsafe promise that it was okay to call the
307+
`#[target_feature]`-annotated function, so it is sound to permit function
308+
pointers.
309+
303310
As scalable vectors will always be passed as immediates, they will therefore
304311
have the same ABI as in C, so should be considered FFI-safe.
305312

0 commit comments

Comments
 (0)