<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/library/std/src/sys/thread_local/key, branch auto</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=auto</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=auto'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2025-05-23T16:00:09+00:00</updated>
<entry>
<title>std: abort the process on failure to allocate a TLS key</title>
<updated>2025-05-23T16:00:09+00:00</updated>
<author>
<name>joboet</name>
<email>jonasboettiger@icloud.com</email>
</author>
<published>2025-05-23T16:00:09+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=8bf515330fb68ba10a54e9087a2b5629a968e766'/>
<id>urn:sha1:8bf515330fb68ba10a54e9087a2b5629a968e766</id>
<content type='text'>
The panic machinery uses TLS, so panicking if no TLS keys are left can lead to infinite recursion (see https://github.com/rust-lang/rust/issues/140798#issuecomment-2872307377). Rather than having separate logic for the panic count and the thread name, just always abort the process if a TLS key allocation fails. This also has the benefit of aligning the key-based TLS implementation with the documentation, which does not mention that a panic could also occur because of resource exhaustion.
</content>
</entry>
<entry>
<title>use generic Atomic type where possible</title>
<updated>2025-04-26T23:18:08+00:00</updated>
<author>
<name>Christopher Durham</name>
<email>cad97@cad97.com</email>
</author>
<published>2024-09-19T04:15:03+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=4d93f6056824c338751f19356d33bb61ce818749'/>
<id>urn:sha1:4d93f6056824c338751f19356d33bb61ce818749</id>
<content type='text'>
in core/alloc/std only for now, and ignoring test files

Co-authored-by: Pavel Grigorenko &lt;GrigorenkoPV@ya.ru&gt;
</content>
</entry>
<entry>
<title>library: Use size_of from the prelude instead of imported</title>
<updated>2025-03-07T04:20:38+00:00</updated>
<author>
<name>Thalia Archibald</name>
<email>thalia@archibald.dev</email>
</author>
<published>2025-03-05T04:28:38+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=988eb1997014987caad878699ee1e7c000214508'/>
<id>urn:sha1:988eb1997014987caad878699ee1e7c000214508</id>
<content type='text'>
Use `std::mem::{size_of, size_of_val, align_of, align_of_val}` from the
prelude instead of importing or qualifying them.

These functions were added to all preludes in Rust 1.80.
</content>
</entry>
<entry>
<title>std: Apply unsafe_attr_outside_unsafe</title>
<updated>2025-02-13T21:10:27+00:00</updated>
<author>
<name>Eric Huss</name>
<email>eric@huss.org</email>
</author>
<published>2025-02-12T22:09:32+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=9e60b0e55428c5f719e6c9f725006434b6f9656d'/>
<id>urn:sha1:9e60b0e55428c5f719e6c9f725006434b6f9656d</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Mark extern blocks as unsafe</title>
<updated>2025-02-09T17:11:13+00:00</updated>
<author>
<name>Michael Goulet</name>
<email>michael@errs.io</email>
</author>
<published>2025-02-07T19:42:33+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=a4e7f8f9bf10588cb5519ae09a15be155499901f'/>
<id>urn:sha1:a4e7f8f9bf10588cb5519ae09a15be155499901f</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Rollup merge of #133472 - rust-wasi-web:master, r=joboet</title>
<updated>2024-12-10T07:55:57+00:00</updated>
<author>
<name>León Orell Valerian Liehr</name>
<email>me@fmease.dev</email>
</author>
<published>2024-12-10T07:55:57+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=ce8d24139627d4154c137445e80bb66a47d87680'/>
<id>urn:sha1:ce8d24139627d4154c137445e80bb66a47d87680</id>
<content type='text'>
Run TLS destructors for wasm32-wasip1-threads

The target wasm32-wasip1-threads has support for pthreads and allows registration of TLS destructors.

For spawned threads, this registers Rust TLS destructors by creating a pthreads key with an attached destructor function.
For the main thread, this registers an `atexit` handler to run the TLS destructors.

try-job: test-various
</content>
</entry>
<entry>
<title>Add libc funcitons only for wasm32-wasip1-threads.</title>
<updated>2024-12-05T11:24:19+00:00</updated>
<author>
<name>Sebastian Urban</name>
<email>surban@surban.net</email>
</author>
<published>2024-12-05T11:24:19+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=4f16640bbf88df43ac34b4c772589931d7d567d2'/>
<id>urn:sha1:4f16640bbf88df43ac34b4c772589931d7d567d2</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Use UNIX thread_local implementation for WASI.</title>
<updated>2024-12-03T15:16:08+00:00</updated>
<author>
<name>Sebastian Urban</name>
<email>surban@surban.net</email>
</author>
<published>2024-12-03T15:16:08+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=4fe15b06e8f3ea9ebcb916df2fd4b2f0e9537296'/>
<id>urn:sha1:4fe15b06e8f3ea9ebcb916df2fd4b2f0e9537296</id>
<content type='text'>
</content>
</entry>
<entry>
<title>update cfgs</title>
<updated>2024-11-27T15:14:54+00:00</updated>
<author>
<name>Boxy</name>
<email>rust@boxyuwu.dev</email>
</author>
<published>2024-11-27T15:14:47+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=22998f078588cf479530ff93e4a66ab4bb666398'/>
<id>urn:sha1:22998f078588cf479530ff93e4a66ab4bb666398</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Re-do recursive const stability checks</title>
<updated>2024-10-25T18:31:40+00:00</updated>
<author>
<name>Ralf Jung</name>
<email>post@ralfj.de</email>
</author>
<published>2024-10-06T17:59:19+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=a0215d8e46aab41219dea0bb1cbaaf97dafe2f89'/>
<id>urn:sha1:a0215d8e46aab41219dea0bb1cbaaf97dafe2f89</id>
<content type='text'>
Fundamentally, we have *three* disjoint categories of functions:
1. const-stable functions
2. private/unstable functions that are meant to be callable from const-stable functions
3. functions that can make use of unstable const features

This PR implements the following system:
- `#[rustc_const_stable]` puts functions in the first category. It may only be applied to `#[stable]` functions.
- `#[rustc_const_unstable]` by default puts functions in the third category. The new attribute `#[rustc_const_stable_indirect]` can be added to such a function to move it into the second category.
- `const fn` without a const stability marker are in the second category if they are still unstable. They automatically inherit the feature gate for regular calls, it can now also be used for const-calls.

Also, several holes in recursive const stability checking are being closed.
There's still one potential hole that is hard to avoid, which is when MIR
building automatically inserts calls to a particular function in stable
functions -- which happens in the panic machinery. Those need to *not* be
`rustc_const_unstable` (or manually get a `rustc_const_stable_indirect`) to be
sure they follow recursive const stability. But that's a fairly rare and special
case so IMO it's fine.

The net effect of this is that a `#[unstable]` or unmarked function can be
constified simply by marking it as `const fn`, and it will then be
const-callable from stable `const fn` and subject to recursive const stability
requirements. If it is publicly reachable (which implies it cannot be unmarked),
it will be const-unstable under the same feature gate. Only if the function ever
becomes `#[stable]` does it need a `#[rustc_const_unstable]` or
`#[rustc_const_stable]` marker to decide if this should also imply
const-stability.

Adding `#[rustc_const_unstable]` is only needed for (a) functions that need to
use unstable const lang features (including intrinsics), or (b) `#[stable]`
functions that are not yet intended to be const-stable. Adding
`#[rustc_const_stable]` is only needed for functions that are actually meant to
be directly callable from stable const code. `#[rustc_const_stable_indirect]` is
used to mark intrinsics as const-callable and for `#[rustc_const_unstable]`
functions that are actually called from other, exposed-on-stable `const fn`. No
other attributes are required.
</content>
</entry>
</feed>
