about summary refs log tree commit diff
path: root/tests/codegen/virtual-function-elimination.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-06-04 05:03:52 +0000
committerbors <bors@rust-lang.org>2024-06-04 05:03:52 +0000
commit27529d5c2526eab5aa03d765426c44ea55c5d269 (patch)
tree5fdf6463de4aabd0023eaf2507a64e90f6e4886b /tests/codegen/virtual-function-elimination.rs
parent90d6255d82dcfd0b73dbaa4f172a7f9886dcc2c1 (diff)
parent6df8d0dd4e05cd96fbc299fa5fc32f37ad936db0 (diff)
downloadrust-27529d5c2526eab5aa03d765426c44ea55c5d269.tar.gz
rust-27529d5c2526eab5aa03d765426c44ea55c5d269.zip
Auto merge of #125525 - joboet:tls_accessor, r=cuviper
Make TLS accessors closures that return pointers

The current TLS macros generate a function that returns an `Option<&'static T>`. This is both risky as we lie about lifetimes, and necessitates that those functions are `unsafe`. By returning a `*const T` instead, the accessor function do not have safety requirements any longer and can be made closures without hassle. This PR does exactly that!

For native TLS, the closure approach makes it trivial to select the right accessor function at compile-time, which could result in a slight speed-up (I have the hope that the accessors are now simple enough for the MIR-inliner to kick in).
Diffstat (limited to 'tests/codegen/virtual-function-elimination.rs')
0 files changed, 0 insertions, 0 deletions