Commit Graph

56037 Commits

Author SHA1 Message Date
Jonathan Brouwer 396f99fcee Rollup merge of #155571 - chrisburel:asan-armv7, r=wesleywiser
Enable AddressSanitizer on arm-unknown-linux-gnueabihf and armv7-unknown-linux-gnueabihf

Add SanitizerSet::ADDRESS to the supported_sanitizers for the arm-unknown-linux-gnueabihf and armv7-unknown-linux-gnueabihf targets.

The AddressSanitizer is already enabled on the armv7-linux-androideabi platform, which shares the same ARM architecture. There is no reason these Linux GNU targets should not also support it, as the underlying LLVM support for ASan on 32-bit ARM is already in place.
2026-04-24 18:19:19 +02:00
Jonathan Brouwer 39d5d45b9a Rollup merge of #155408 - teor2345:rustdoc-env-names, r=lolbinarycat
rustdoc: Fix Managarm C Library name in cfg pretty printer

Like rust-lang/rust#155293, this was introduced in https://github.com/rust-lang/rust/pull/154328.

Unlike that PR, I don't think there's any need to backport, because this cfg is not used anywhere in the standard library.
(I searched for `"mlibc"`, the only place it's used in rust-lang/rust is the HTML doc test.)

#### Other Minor Fixes

Remove a FIXME comment in the pretty printer, `os = "none"` is always bare metal:
https://github.com/rust-lang/rust/blob/d227e48c560e915fe7c0b8b3e821680a3a0ba739/compiler/rustc_target/src/spec/mod.rs#L3179

Fix a comment typo, ignore another typo in vendored sources.
2026-04-24 18:19:18 +02:00
Jonathan Brouwer a51a163574 Rollup merge of #155219 - nataliakokoromyti:fix-155088-borrow-suggestion-v2, r=JohnTitor
Do not suggest borrowing enclosing calls for nested where-clause obligations

In rust-lang/rust#155088, the compiler was blaming the whole call expr instead of the value that  actually failed the trait bound, so for foo(&[String::from("a")]) it was suggesting stuff like &foo(...). I changed the suggestion logic so it only emits borrow help if the expr it found actually matches the failed self type,  and used the same check for the “similar impl exists” help too. So now the compiler should give the normal error + required bound note.

Fix rust-lang/rust#155088
2026-04-24 18:19:17 +02:00
Jonathan Brouwer 08571af24d Rollup merge of #153537 - taiki-e:ef-sparc-32plus, r=wesleywiser
rustc_codegen_ssa: Define ELF flag value for sparc-unknown-linux-gnu

Currently, attempting to build this target using Ubuntu/Debian's sparc64-multilib toolchain results in the following link error ([full log](https://github.com/taiki-e/atomic-maybe-uninit/actions/runs/22798868888/job/66137493862#step:15:442)):

```
  = note: /usr/lib/gcc-cross/sparc64-linux-gnu/13/../../../../sparc64-linux-gnu/bin/ld: unknown architecture of input file `/home/runner/work/atomic-maybe-uninit/atomic-maybe-uninit/target/sparc-unknown-linux-gnu/debug/deps/rustcYzaDYW/symbols.o' is incompatible with sparc:v8plus output
```

This appears to be caused by the required e_flag being missing and can be fixed by setting `EF_SPARC_32PLUS`.

Tested using rustc with this patch applied and qemu-user (https://github.com/taiki-e/atomic-maybe-uninit/commit/57d7e7f9905cb5f7bc1254e5527af27b42c99c6a, [log](https://github.com/taiki-e/atomic-maybe-uninit/actions/runs/22798793270/job/66137298093)).

Related discussion: https://github.com/rust-lang/rust/pull/131222#issuecomment-2393473488

r? workingjubilee
cc @glaubitz

@rustbot label +O-SPARC
2026-04-24 18:19:16 +02:00
Jonathan Brouwer bbdfe217d4 Rollup merge of #155730 - oli-obk:cleanups, r=petrochenkov
Some cleanups around per parent disambiguators

r? @petrochenkov

follow-up to rust-lang/rust#155547

The two remaining uses are

* resolve_bound_vars, where it is a reasonable way to do it instead of having another field in the visitor that needs to get scoped (set & reset) every time we visit an opaque type. May still change that at some point, but it's not really an issue
* `create_def` in the resolver: will get removed together with my other refactorings for `node_id_to_def_id` (making that per-owner)
2026-04-24 18:19:16 +02:00
Jonathan Brouwer ef162a52dc Rollup merge of #155635 - aerooneqq:delegation-generics-Self-rename, r=petrochenkov
delegation: rename `Self` generic param to `This` in recursive delegations

This PR supports renaming of `Self` generic parameter to `This` in recursive delegations scenario, this allows propagation of `This` as we rely on `Self` naming to check whether it is implicit Self of a trait. Comment with a bit deeper explanation is in `uplift_delegation_generic_params`. Part of rust-lang/rust#118212.

r? @petrochenkov
2026-04-24 18:19:15 +02:00
Oli Scherer bfb085da9f All generated associated types for opaque types in traits/impls have the same parent 2026-04-24 12:55:11 +02:00
Oli Scherer e90878b9f2 All nested statics in a single interning run have the same parent
So we do not need to disambiguate considering parents
2026-04-24 12:45:55 +02:00
aerooneqq 7f2a98d1fc Rename Self generic param to This in recursive delegations 2026-04-24 09:59:20 +03:00
Jacob Pratt 87c27a9322 Rollup merge of #155706 - GuillaumeGomez:rm-attributelintkind, r=JonathanBrouwer
Remove `AttributeLintKind` variants - part 7

Part of https://github.com/rust-lang/rust/issues/153099.

It's the last easy one. Next one will require to get the crate name and to pass `Session` to the remaining lints. Fun times ahead. :)

r? @JonathanBrouwer
2026-04-24 02:42:53 -04:00
Jacob Pratt 1230f74ad5 Rollup merge of #155698 - fmease:no-struct-pat-tuple-index-shorthand, r=mu001999
Syntactically reject tuple index shorthands in struct patterns to fix a correctness regression

Split out of PR rust-lang/rust#154492. This fixes a correctness regression introduced in PR rust-lang/rust#81235 from 2021. Crater was run in my other PR and didn't report any real regressions (https://github.com/rust-lang/rust/pull/154492#issuecomment-4187544786); a rerun has been issued for a few spurious builds (https://github.com/rust-lang/rust/pull/154492#issuecomment-4237077272) but I'm certain it won't find anything either.

This is a theoretical breaking change that doesn't need any T-lang input IMHO since it's such a minute, niche and crystal clear bug that's not worth bothering them with (such a decision is not unprecedented). I'm adding it to the compatibility section of the release notes as is customary.

The Reference doesn't need updating since it didn't adopt this bug and thus accurately describes this part of the grammar as it used to be before 2021-02-23 and as it's meant to be.

The majority of the diff is doc comment additions & necessary UI test restructurings.
2026-04-24 02:42:52 -04:00
Jacob Pratt 0c253816ab Rollup merge of #155663 - nnethercote:eliminate-CrateMetadataRef, r=mejrs,petrochenkov
Eliminate `CrateMetadataRef`.

There are a number of things I dislike about `CrateMetadataRef`.
- It contains two fields `cstore` and `cdata`. The latter points to data within the former. It's like having an `Elem` type that has a reference to a vec element and also a reference to the vec itself. Weird.
- The `cdata` field gets a lot of use, and the `Deref` impl just derefs that field. The `cstore` field is rarely used.
- `CrateMetadataRef` is not a good name.
- Variables named `cdata` sometimes refer to values of this type and sometimes to values of type `CrateMetadata`, which is confusing.

The good news is that `CrateMetadataRef` is not necessary and can be replaced with `&CrateMetadata`. Why? Everywhere that `CrateMetadataRef` is used, a `TyCtxt` is also present, and the `CStore` is accessible from the `TyCtxt` with `CStore::from_tcx`.

So this commit removes `CrateMetadataRef` and replaces all its uses with `&CrateMetadata`. Notes:
- This requires adding only two uses of `CStore::from_tcx`, which shows how rarely the `cstore` field was used.
- `get_crate_data` now matches `get_crate_data_mut` more closely.
- A few variables are renamed for consistency, e.g. `data`/`cmeta` -> `cdata`.
- An unnecessary local variable (`local_cdata`) in `decode_expn_id` is removed.
- All the `CrateMetadataRef` methods become `CrateMetadata` methods, and their receiver changes from `self` to `&self`.
- `RawDefId::decode_from_cdata` is inlined and removed, because it has a single call site.

r? @mejrs
2026-04-24 02:42:51 -04:00
Jacob Pratt cdba0cea17 Rollup merge of #155379 - ashivaram23:mir-query-cycle, r=saethlin
Avoid query cycles in DataflowConstProp

Fixes rust-lang/rust#155376 by skipping coroutines.
2026-04-24 02:42:50 -04:00
Ben Kimock 4b1f3926de Avoid query cycles in DataflowConstProp
* Avoid query cycles in DataflowConstProp
* Add -Zmir-opt-level=0 to the test
2026-04-24 03:04:03 +00:00
bors d493b7c5ac Auto merge of #155710 - tgross35:rollup-skXlTFI, r=tgross35
Rollup of 7 pull requests

Successful merges:

 - rust-lang/rust#155660 (c-variadic: fix for sparc64)
 - rust-lang/rust#153482 (tests/ui/macros: add annotations for reference rules)
 - rust-lang/rust#155075 (Add docs about SDKs and C compilation on armv7a-vex-v5)
 - rust-lang/rust#155685 (Fix `get_child_at_index` return type hints)
 - rust-lang/rust#155686 (Fix array template arg lookup behavior)
 - rust-lang/rust#155689 (Const initialize `LOCK_LATCH` thread local)
 - rust-lang/rust#155690 (Fix classify_union to return Union for regular unions)
2026-04-24 02:27:01 +00:00
Trevor Gross b7f0235416 Rollup merge of #155689 - zetanumbers:lock_latch_thread_local, r=ShoyuVanilla
Const initialize `LOCK_LATCH` thread local

A simple refactor to avoid runtime thread-local initialization.
2026-04-23 20:32:51 -04:00
Trevor Gross 85468d1fdb Rollup merge of #155660 - folkertdev:sparc64-c-variadic, r=tgross35
c-variadic: fix for sparc64

tracking issue: https://github.com/rust-lang/rust/issues/44930

Turns out it's a big-endian target that right-adjusts values in the stack slots.

Apparently these tests do get run occasionally, though i don't think test failures are usually turned into issues on this repo. I guess we could add an assembly test here too, though really you just have to run these tests. I've tried this locally with qemu, and it passes all c-variadic tests.

cc @thejpster @glaubitz
r? tgross35
2026-04-23 20:32:48 -04:00
Nicholas Nethercote 804e419ed8 Eliminate CrateMetadataRef.
There are a number of things I dislike about `CrateMetadataRef`.
- It contains two fields `cstore` and `cdata`. The latter points to data
  within the former. It's like having an `Elem` type that has a
  reference to a vec element and also a reference to the vec itself.
  Weird.
- The `cdata` field gets a lot of use, and the `Deref` impl just derefs
  that field. The `cstore` field is rarely used.
- `CrateMetadataRef` is not a good name.
- Variables named `cdata` sometimes refer to values of this type and
  sometimes to values of type `CrateMetadata`, which is confusing.

The good news is that `CrateMetadataRef` is not necessary and can be
replaced with `&CrateMetadata`. Why? Everywhere that `CrateMetadataRef`
is used, a `TyCtxt` is also present, and the `CStore` is accessible from
the `TyCtxt` with `CStore::from_tcx`.

So this commit removes `CrateMetadataRef` and replaces all its uses with
`&CrateMetadata`. Notes:
- This requires adding only two uses of `CStore::from_tcx`, which shows
  how rarely the `cstore` field was used.
- `get_crate_data` now matches `get_crate_data_mut` more closely.
- A few variables are renamed for consistency, e.g. `data`/`cmeta` ->
  `cdata`.
- An unnecessary local variable (`local_cdata`) in `decode_expn_id` is
  removed.
- All the `CrateMetadataRef` methods become `CrateMetadata` methods, and
  their receiver changes from `self` to `&self`.
- `RawDefId::decode_from_cdata` is inlined and removed, because it has a
  single call site.
2026-04-24 10:02:13 +10:00
bors 9836b06b55 Auto merge of #155671 - nnethercote:simplify-Config-track_state, r=bjorn3
Simplify `Config::track_state`.

This is a callback used to track otherwise untracked state. It was added in rust-lang/rust#116731 for Clippy. (It was originally named `hash_untracked_state`, and examples in the rustc-dev-guide still use that name.) The `StableHasher` argument is unused, and probably has never been used. There is a FIXME comment pointing this out, which was added more than a year ago.

This commit removes the `StableHasher` callback argument. This also removes the need for `Options::untracked_state_hash`.

r? @bjorn3
2026-04-23 23:05:00 +00:00
Guillaume Gomez 7a07b79573 Remove AttributeLintKind::NonMetaItemDiagnosticAttribute variant 2026-04-23 23:08:40 +02:00
Guillaume Gomez 87b0ce595c Remove AttributeLintKind::MissingOptionsForDiagnosticAttribute variant 2026-04-23 23:00:38 +02:00
León Orell Valerian Liehr 07d015e566 Syntactically reject tuple index shorthands in struct patterns to fix a correctness regression 2026-04-23 22:28:00 +02:00
bors 36ba2c7712 Auto merge of #155687 - GuillaumeGomez:rollup-aZ7YrAD, r=GuillaumeGomez
Rollup of 7 pull requests

Successful merges:

 - rust-lang/rust#155469 (Account for titlecase in casing lints)
 - rust-lang/rust#155644 (delegation: support self ty propagation for functions in free to trait reuse)
 - rust-lang/rust#154957 (Fix ICE when const closure appears inside a non-const trait method)
 - rust-lang/rust#155442 (Change keyword order for `impl` restrictions)
 - rust-lang/rust#155561 (Use singular wording for single _ placeholders in type suggestions)
 - rust-lang/rust#155637 (Fix E0191 suggestion for empty dyn trait args)
 - rust-lang/rust#155661 (Remove `AttributeLintKind` variants - part 6)
2026-04-23 15:55:48 +00:00
Daria Sukhonina 892f176d89 Const initialize LOCK_LATCH thread local 2026-04-23 16:06:24 +03:00
Folkert de Vries 797059769e c-variadic: fix for sparc64
validated versus https://godbolt.org/z/qrM37rY6n
2026-04-23 14:46:44 +02:00
Guillaume Gomez 0a4e73e9bf Rollup merge of #155661 - GuillaumeGomez:rm-attributelintkind, r=JonathanBrouwer
Remove `AttributeLintKind` variants - part 6

Part of https://github.com/rust-lang/rust/issues/153099.

r? @JonathanBrouwer
2026-04-23 14:42:50 +02:00
Guillaume Gomez 8a4df7744f Rollup merge of #155637 - qaijuang:fix-e0191-empty-dyn-trait-suggestion, r=fmease
Fix E0191 suggestion for empty dyn trait args

Fixes rust-lang/rust#155578.
2026-04-23 14:42:49 +02:00
Guillaume Gomez 8c3864b6cc Rollup merge of #155561 - cijiugechu:fix/need-type-info-underscore-wording, r=adwinwhite
Use singular wording for single _ placeholders in type suggestions

While looking this part of code, I noticed this FIXME and fixed it :)
2026-04-23 14:42:48 +02:00
Guillaume Gomez abce9f98d7 Rollup merge of #155442 - CoCo-Japan-pan:impl-restriction-reorder, r=Urgau,fmease,jhpratt
Change keyword order for `impl` restrictions

Based on rust-lang/rust#155222, this PR reorders keywords in trait definitions to group restrictions with visibility. It changes the order from `pub(...) const unsafe auto impl(...) trait Foo {...}`  to `pub(...) impl(...) const unsafe auto trait Foo {...}`.

Tracking issue for restrictions: rust-lang/rust#105077

r? @Urgau
cc @jhpratt
2026-04-23 14:42:47 +02:00
Guillaume Gomez 0595fcd195 Rollup merge of #154957 - lapla-cogito:issue_153891, r=oli-obk
Fix ICE when const closure appears inside a non-const trait method

Fixes rust-lang/rust#153891

`hir_body_const_context()` unconditionally delegated to the parent's const context for const closures, returning `None` when the parent had no const context. This caused `mir_const_qualif()` to hit a `span_bug!`, since `mir_promoted()` had already decided to call it based on the closure's own syntactic constness. Fall back to `ConstContext::ConstFn` when the parent's const context is `None`, so that the const closure body is still properly const-checked rather than triggering an ICE.

Examining [another attempt](https://github.com/rust-lang/rust/pull/153900/changes) at this issue (which has already been closed), I thought that its approach represents a workaround fix to avoid inconsistencies in the caller of `mir_promoted()`, whereas I think the correct behavior is for `hir_body_const_context()` itself to return the proper value.
2026-04-23 14:42:47 +02:00
Guillaume Gomez aebbe6bb5f Rollup merge of #155644 - aerooneqq:delegation-self-ty-propagation-2, r=petrochenkov
delegation: support self ty propagation for functions in free to trait reuse

This PR adds support for self types specified in free to trait reuse. Up to this point we always generated `Self` despite the fact whether self type was specified or not. Now we use it in signature inheritance. Moreover we no more generate `Self` for static methods. Part of rust-lang/rust#118212.

```rust
trait Trait<T> {
  fn foo<const B: bool>(&self) {}
  fn bar() {}
}

impl<T> Trait<T> for usize {}

reuse <usize as Trait>::foo;

// Desugaring (no `Self` as usize is specified)
fn foo<T, const B: bool>(self: &usize) {
  <usize as Trait::<T>>::foo::<B>(self)
}

reuse Trait::bar;

// Desugaring (no `Self` as static method)
fn bar<T>() {
  Trait::<T>::bar(); //~ERROR: type annotations needed
}
```

r? @petrochenkov
2026-04-23 14:42:46 +02:00
Guillaume Gomez 4f4c1d553e Rollup merge of #155469 - Jules-Bertholet:titlecase-idents, r=petrochenkov
Account for titlecase in casing lints

Puts https://github.com/rust-lang/rust/issues/153892 to work.

Also contains fixes for Greek final sigma casing.

There are probably still some edge cases left to fix. Ideally we would use https://www.unicode.org/reports/tr55/#Identifier-Chunks as a base.

@rustbot label A-Unicode A-diagnostics A-lints A-suggestion-diagnostics
2026-04-23 14:42:45 +02:00
Guillaume Gomez b716ebc7d1 Remove AttributeLintKind::IgnoredDiagnosticOption variant 2026-04-23 14:38:34 +02:00
Guillaume Gomez f9cb684215 Remove AttributeLintKind::DiagnosticWrappedParserError variant 2026-04-23 14:38:34 +02:00
Guillaume Gomez eb8be4f991 Remove AttributeLintKind::MalformedDiagnosticFormat variant 2026-04-23 14:38:34 +02:00
Guillaume Gomez 9bf2522cf0 Remove AttributeLintKind::MalFormedDiagnosticAttribute variant 2026-04-23 14:38:33 +02:00
Guillaume Gomez ad11f2efec Remove AttributeLintKind::ExpectedNameValue variant 2026-04-23 14:33:25 +02:00
Guillaume Gomez af3652c1dc Remove AttributeLintKind::ExpectedNoArgs variant 2026-04-23 14:33:25 +02:00
Guillaume Gomez 359910e21e Remove AttributeLintKind::MalformedDoc variant 2026-04-23 14:33:25 +02:00
Qai Juang 4d2b607aa8 Fix E0191 suggestion for empty dyn trait args
* Fix E0191 suggestion for empty dyn trait args
* Fix tidy check
* address code nit
* fold test into existing E0191 test
2026-04-23 12:32:33 +00:00
bors 2eaa5de4a3 Auto merge of #155628 - nnethercote:CStore-from_tcx, r=mu001999
Streamline `CrateMetadataRef` construction in `provide_one!`.

`cstore.get_crate_data()` creates a `CrateMetadataRef`, which is exactly what we need. The current code is very confused and does several unnecessary things: mapping the `FreezeReadGuard` and calling `CStore::from_tcx` a second time to construct a second `CrateMetadataRef`.

This is a small perf win.

r? @mu001999
2026-04-23 12:32:22 +00:00
bors 827651f220 Auto merge of #155674 - JonathanBrouwer:rollup-NG1fnzG, r=JonathanBrouwer
Rollup of 10 pull requests

Successful merges:

 - rust-lang/rust#146544 (mir-opt: Remove the workaround in UnreachableEnumBranching)
 - rust-lang/rust#154819 (Fix ICE for inherent associated type mismatches)
 - rust-lang/rust#155265 (Improved assumptions relating to isqrt)
 - rust-lang/rust#152576 (c-variadic: use `emit_ptr_va_arg` for  mips)
 - rust-lang/rust#154481 (Mark a function only used in nightly as nightly only)
 - rust-lang/rust#155614 (c-variadic: rename `VaList::arg` to `VaList::next_arg`)
 - rust-lang/rust#155630 (Make `//@ skip-filecheck` a normal compiletest directive)
 - rust-lang/rust#155641 (Remove non-working code for "running" mir-opt tests)
 - rust-lang/rust#155652 (Expand `Path::is_empty` docs)
 - rust-lang/rust#155656 (rustc_llvm: update opt-level handling for LLVM 23)
2026-04-23 08:38:23 +00:00
Jonathan Brouwer 0fa807c149 Rollup merge of #155656 - durin42:llvm-23-back-in-kansas, r=nikic
rustc_llvm: update opt-level handling for LLVM 23

LLVM 23 removed Os and Oz optimization pipelines and the PR says to use O2 with optsize or minsize instead as appropriate.

See https://github.com/llvm/llvm-project/pull/191363 for more details.
2026-04-23 09:38:26 +02:00
Jonathan Brouwer 421a94fc88 Rollup merge of #154481 - ferrocene:hoverbear/flag-off-unused-code, r=wesleywiser
Mark a function only used in nightly as nightly only

If you run `./x.py test rustc_next_trait_solver` you'll currently see a failure:

```
warning: method `merge` is never used
  --> compiler/rustc_abi/src/callconv.rs:38:8
   |
25 | impl HomogeneousAggregate {
   | ------------------------- method in this implementation
...
38 |     fn merge(self, other: HomogeneousAggregate) -> Result<HomogeneousAggregate, Heterogeneous> {
   |        ^^^^^
   |
   = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default

warning: `rustc_abi` (lib) generated 1 warning
```

This is because the usages are behind a nightly feature flag:

https://github.com/rust-lang/rust/blob/fda6d37bb88ee12fd50fa54d15859f1f91b74f55/compiler/rustc_abi/src/callconv.rs#L52

https://github.com/rust-lang/rust/blob/fda6d37bb88ee12fd50fa54d15859f1f91b74f55/compiler/rustc_abi/src/callconv.rs#L131

https://github.com/rust-lang/rust/blob/fda6d37bb88ee12fd50fa54d15859f1f91b74f55/compiler/rustc_abi/src/callconv.rs#L167

This does the flag off.

Test on `main` and this branch:

```
./x.py test rustc_next_trait_solver
```
2026-04-23 09:38:23 +02:00
Jonathan Brouwer 6cc506c5db Rollup merge of #152576 - folkertdev:mips-va-arg, r=tgross35
c-variadic: use `emit_ptr_va_arg` for  mips

tracking issue: https://github.com/rust-lang/rust/issues/44930

After reading the implementation carefully, I believe it really is just `emit_ptr_va_arg`.

The LLVM implementation can be found here: https://github.com/llvm/llvm-project/blob/289a3292be0c6a3df86bcdf5be7dd05b79a5570c/llvm/lib/Target/Mips/MipsISelLowering.cpp#L2338.

r? workingjubilee
2026-04-23 09:38:22 +02:00
Jonathan Brouwer 280345333a Rollup merge of #154819 - cijiugechu:fix-next-solver-inherent-iat-ice, r=jackh726
Fix ICE for inherent associated type mismatches

Avoid projection-only suggestions for inherent associated types.

Closes rust-lang/rust#154333
Closes rust-lang/rust#155204
2026-04-23 09:38:20 +02:00
Jonathan Brouwer 032b666d6a Rollup merge of #146544 - dianqk:rm-workaround, r=wesleywiser
mir-opt: Remove the workaround in UnreachableEnumBranching

rust-lang/rust#120268 added a workaround due to the compile time of TailDuplicator.

LLVM 20 has resolved this in llvm/llvm-project#114990 and llvm/llvm-project#132536.
2026-04-23 09:38:20 +02:00
teor 34c0fe8778 Fix some typos 2026-04-23 17:07:21 +10:00
bors 92c7010294 Auto merge of #155609 - cuviper:thread_pool-seq-cst, r=jieyouxu
rustc_thread_pool: Make `CoreLatch::set` use `SeqCst` instead of `AcqRel`

Every other modification of this variable uses `SeqCst`, which is justified in the sleep README. This particular choice of `AcqRel` was not discussed during its addition in rayon-rs/rayon#746, nor rayon-rs/rfcs#5, so I suspect was simply an oversight from earlier development. We probably do want this to participate in the same sequential consistency.

The only other ordering difference is `CoreLatch::probe`'s load with `Acquire`, which should be fine because this doesn't need consistency with the sleep counters.

See also rayon-rs/rayon#1297. As I commented there, I think in practice this would be quite rare to cause any problems, but it *could* be a source of non-deterministic bugs on targets with weak memory ordering.
2026-04-23 05:30:11 +00:00
Nicholas Nethercote 3c5e7e8969 Simplify Config::track_state.
This is a callback used to track otherwise untracked state. It was added
in #116731 for Clippy. (It was originally named `hash_untracked_state`,
and examples in the rustc-dev-guide still use that name.) The
`StableHasher` argument is unused, and probably has never been used.
There is a FIXME comment pointing this out, which was added more than a
year ago.

This commit removes the `StableHasher` callback argument. This also
removes the need for `Options::untracked_state_hash`.
2026-04-23 15:02:55 +10:00