diff options
| author | Gary Guo <gary@garyguo.net> | 2026-09-01 17:50:26 +0100 |
|---|---|---|
| committer | Danilo Krummrich <dakr@kernel.org> | 2026-09-06 13:39:26 +0200 |
| commit | 1fc1f82756b1ff872c04950747925f7dcf5c1d8a (patch) | |
| tree | 06bc62ca54ab7b817f369970060c901a88fae40a /scripts/Makefile.thinlto | |
| parent | 63b2578517df761ec8aed607b29e24c0e2655410 (diff) | |
| download | linux-next-1fc1f82756b1ff872c04950747925f7dcf5c1d8a.tar.gz linux-next-1fc1f82756b1ff872c04950747925f7dcf5c1d8a.zip | |
rust: mem: add `transmute` with deferred size check
Implement a `transmute/safe_transmute` that checks size at
monomorphization time instead of type-checking time. This allows more cases
where we know that the size matches but this is not generically checkable.
The signature is equivalent to the unstable `transmute_neo` function in the
standard library. A safe variant is provided to use with types implementing
`FromBytes` and `IntoBytes`.
Existing users of `transmute_copy` to bypass size checks are converted.
Signed-off-by: Gary Guo <gary@garyguo.net>
Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>
Tested-by: Alexandre Courbot <acourbot@nvidia.com>
Acked-by: Miguel Ojeda <ojeda@kernel.org>
Link: https://patch.msgid.link/20260901-typed_register-v4-2-5552b1d59525@garyguo.net
[ Fix doc heading to use plural "Examples", add missing closing code
block delimiter and fix a few other nits. - Danilo ]
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
Diffstat (limited to 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions
