Transmute from one function pointer to another produces "can't transmute zero-sized type" #75959
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-raw-pointers
Area: raw pointers, MaybeUninit, NonNull
A-ZSTs
Area: Zero-sized types (ZSTs).
C-bug
Category: This is a bug.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Compiling the following cursed code:
Produces the following opaque error:
I'm not exactly sure why
transmute
won't let me go from one function pointer type to another, but even if that restriction remains, the error message could be more helpful. (My workaround was to useas isize
before invokingtransmute
.)Meta
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: