<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/library/std/src/thread/local.rs, branch 1.84.1</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=1.84.1</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=1.84.1'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2024-10-25T18:31:40+00:00</updated>
<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>
<entry>
<title>Fix std tests for wasm32-wasip2 target</title>
<updated>2024-09-29T02:48:13+00:00</updated>
<author>
<name>Nicola Krumschmidt</name>
<email>git@nkcom.de</email>
</author>
<published>2024-09-04T00:18:32+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=87f17f3ccb69e9827562522ae1a38f84d2ba998a'/>
<id>urn:sha1:87f17f3ccb69e9827562522ae1a38f84d2ba998a</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Replace `move||` with `move ||` in `compiler/` and `library/`</title>
<updated>2024-06-18T15:25:08+00:00</updated>
<author>
<name>Vonr</name>
<email>dtaclanlegion@gmail.com</email>
</author>
<published>2024-06-18T15:25:08+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=7321e791141ddf2ec4d5f8a9893146832118bb19'/>
<id>urn:sha1:7321e791141ddf2ec4d5f8a9893146832118bb19</id>
<content type='text'>
Edit from #126631 to revert changes on ui tests
</content>
</entry>
<entry>
<title>std: make TLS accessors closures that return pointers</title>
<updated>2024-05-24T22:19:47+00:00</updated>
<author>
<name>joboet</name>
<email>jonasboettiger@icloud.com</email>
</author>
<published>2024-05-24T22:19:47+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=1052d2931cbc32ffb6e1b648f4d7e248d5fdd889'/>
<id>urn:sha1:1052d2931cbc32ffb6e1b648f4d7e248d5fdd889</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Change method calls to using the method directly</title>
<updated>2024-04-08T21:48:07+00:00</updated>
<author>
<name>Trevor Gross</name>
<email>tmgross@umich.edu</email>
</author>
<published>2024-04-08T21:48:07+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=313085f7258ef86cf190aa6c234a42843995fdbc'/>
<id>urn:sha1:313085f7258ef86cf190aa6c234a42843995fdbc</id>
<content type='text'>
This is in accordance with Clippy's redundant_closure_for_method_calls.
</content>
</entry>
<entry>
<title>Add `SAFETY` comments to the thread local implementation</title>
<updated>2024-04-08T21:47:09+00:00</updated>
<author>
<name>Trevor Gross</name>
<email>tmgross@umich.edu</email>
</author>
<published>2024-04-08T21:47:09+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=6e68a2f475593f15c9bb3fdbe9b53633a5aa0659'/>
<id>urn:sha1:6e68a2f475593f15c9bb3fdbe9b53633a5aa0659</id>
<content type='text'>
Reduce `unsafe` block scope and add `SAFETY` comments.
</content>
</entry>
<entry>
<title>Update thread local docs with idiomatic cell type use</title>
<updated>2024-04-08T21:43:24+00:00</updated>
<author>
<name>Trevor Gross</name>
<email>tmgross@umich.edu</email>
</author>
<published>2024-04-08T21:43:24+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=2aec2fe3b8315741432a941f58b087d1311d9a44'/>
<id>urn:sha1:2aec2fe3b8315741432a941f58b087d1311d9a44</id>
<content type='text'>
The `thread_local!` examples use `RefCell` for `Copy` types. Update
examples to have one `Copy` and one non-`Copy` type using `Cell` and
`RefCell`, respectively.
</content>
</entry>
<entry>
<title>Get rid of some `#[allow(static_mut_refs)]`</title>
<updated>2024-02-23T15:02:25+00:00</updated>
<author>
<name>Pavel Grigorenko</name>
<email>grigorenkopv@ya.ru</email>
</author>
<published>2024-02-23T11:09:37+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=58c8c0853f08d83a86edfc9cd73463ff29f0509f'/>
<id>urn:sha1:58c8c0853f08d83a86edfc9cd73463ff29f0509f</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Add `rustc_confusables` annotations to some stdlib APIs</title>
<updated>2024-02-22T18:04:55+00:00</updated>
<author>
<name>Esteban Küber</name>
<email>esteban@kuber.com.ar</email>
</author>
<published>2024-02-07T02:35:49+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=e5b3c7ef1439fa946b3ba49a3bbbadc34d801a84'/>
<id>urn:sha1:e5b3c7ef1439fa946b3ba49a3bbbadc34d801a84</id>
<content type='text'>
Help with common API confusion, like asking for `push` when the data structure really has `append`.

```
error[E0599]: no method named `size` found for struct `Vec&lt;{integer}&gt;` in the current scope
  --&gt; $DIR/rustc_confusables_std_cases.rs:17:7
   |
LL |     x.size();
   |       ^^^^
   |
help: you might have meant to use `len`
   |
LL |     x.len();
   |       ~~~
help: there is a method with a similar name
   |
LL |     x.resize();
   |       ~~~~~~
```

#59450
</content>
</entry>
<entry>
<title>Improve wording of static_mut_ref</title>
<updated>2024-02-18T03:01:40+00:00</updated>
<author>
<name>Obei Sideg</name>
<email>obei.sideg@gmail.com</email>
</author>
<published>2024-02-17T19:01:56+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=408eeae59d35cbcaab2cfb345d24373954e74fc5'/>
<id>urn:sha1:408eeae59d35cbcaab2cfb345d24373954e74fc5</id>
<content type='text'>
Rename `static_mut_ref` lint to `static_mut_refs`.
</content>
</entry>
</feed>
