Commit Graph

320523 Commits

Author SHA1 Message Date
Guillaume dceeb20bbc Fix LegacyKeyValueFormat report from docker build: various 2026-03-07 10:26:23 +01:00
bors ea5573a6c6 Auto merge of #153519 - JonathanBrouwer:rollup-Soq8THm, r=JonathanBrouwer
Rollup of 5 pull requests

Successful merges:

 - rust-lang/rust#149937 (spliit out `linker-info` from `linker-messages`)
 - rust-lang/rust#153503 (Fallback to fat LTO for -Clto=thin in cg_gcc)
 - rust-lang/rust#153346 (move never type tests to subdirectories and add some comments)
 - rust-lang/rust#153371 (Fix LegacyKeyValueFormat report from docker build: arm)
 - rust-lang/rust#153508 (Clean up the eager formatting API)
2026-03-07 03:26:12 +00:00
Jonathan Brouwer f540b27f90 Rollup merge of #153508 - JonathanBrouwer:improved_eager_format, r=GuillaumeGomez
Clean up the eager formatting API

For https://github.com/rust-lang/rust/issues/151366#event-22181360642

Previously eager formatting worked by throwing the arguments into a diag, formatting, then removing the args again. This is ugly so instead we now just do the formatting completely separately.
This PR has nice commits, so I recommend reviewing commit by commit.

r? @GuillaumeGomez
2026-03-07 01:42:37 +01:00
Jonathan Brouwer ec5e4aacbc Rollup merge of #153371 - homersimpsons:chore/fix-LegacyKeyValueFormat-arm, r=marcoieni
Fix LegacyKeyValueFormat report from docker build: arm

Part of rust-lang/rust#152305

r? @marcoieni
2026-03-07 01:42:37 +01:00
Jonathan Brouwer cecc5e7cea Rollup merge of #153346 - WaffleLapkin:sometimes-test, r=jieyouxu
move never type tests to subdirectories and add some comments

This hopefully makes things a little bit clearer
2026-03-07 01:42:36 +01:00
Jonathan Brouwer feeeea9ad1 Rollup merge of #153503 - bjorn3:cg_gcc_thin_lto_fallback, r=antoyo
Fallback to fat LTO for -Clto=thin in cg_gcc

Fallback to no LTO doesn't work in practice as Cargo asks rustc to produce LTO-only rlibs with -Clinker-plugin-lto without providing any indication if they will be used for thin or fat LTO, so we can't disable -Clinker-plugin-lto for ThinLTO when using cg_gcc.

r? @antoyo
2026-03-07 01:42:36 +01:00
Jonathan Brouwer 783c9d3de0 Rollup merge of #149937 - jyn514:linker-info, r=mati865
spliit out `linker-info` from `linker-messages`

*[View all comments](https://triagebot.infra.rust-lang.org/gh-comments/rust-lang/rust/pull/149937)*

Helps with https://github.com/rust-lang/rust/issues/136096.
2026-03-07 01:42:35 +01:00
Jonathan Brouwer 7baf2be12a Fix uitests 2026-03-07 01:23:58 +01:00
bors 80282b1306 Auto merge of #153507 - JonathanBrouwer:rollup-ki59UTE, r=JonathanBrouwer
Rollup of 14 pull requests

Successful merges:

 - rust-lang/rust#153466 (`rust-analyzer` subtree update)
 - rust-lang/rust#151280 (Fix incorrect trailing comma suggested in no_accessible_fields)
 - rust-lang/rust#152593 (Box in `ValTreeKind::Branch(Box<[I::Const]>)` changed to `List`)
 - rust-lang/rust#153174 (std: add wasm64 to sync::Once and thread_parking atomics cfg guards)
 - rust-lang/rust#153485 (libcore float tests: replace macro shadowing by const-compatible macro)
 - rust-lang/rust#153495 (Fix ICE in `offset_of!` error recovery)
 - rust-lang/rust#152040 (Do not emit ConstEvaluatable goals if type-const)
 - rust-lang/rust#152741 (Suppress invalid suggestions in destructuring assignment)
 - rust-lang/rust#153189 (refactor: move `check_align` to `parse_alignment`)
 - rust-lang/rust#153230 (Roll rustfmt reviewers for in-tree rustfmt)
 - rust-lang/rust#153445 (Consider try blocks as block-like for overflowed expr)
 - rust-lang/rust#153452 (Cleanup unused diagnostic emission methods)
 - rust-lang/rust#153476 (bootstrap.py: fix typo "parallle")
 - rust-lang/rust#153483 (Preserve parentheses around `Fn` trait bounds in pretty printer)
2026-03-06 19:09:12 +00:00
Jonathan Brouwer 4e0b64408c Fix newly detected subdiagnostics using variables from parent 2026-03-06 19:00:25 +01:00
Jonathan Brouwer e58ddb5ae5 Fix variable_references logic to catch all variable references 2026-03-06 18:52:11 +01:00
Jonathan Brouwer 10eb844bac Remove eagerly_format_to_string from DiagCtxt 2026-03-06 18:52:11 +01:00
Jonathan Brouwer 8c87d0761f Remove eagerly_format from DiagCtxt 2026-03-06 18:52:11 +01:00
Jonathan Brouwer 43221b43b6 Remove eagerly_format from Diag 2026-03-06 18:52:11 +01:00
Jonathan Brouwer 828c0c0668 Remove remove_arg from diagnostics 2026-03-06 18:52:11 +01:00
Jonathan Brouwer c2f1e9d71d Remove stored args from diagnostics 2026-03-06 18:52:11 +01:00
Jonathan Brouwer 2b0552f0cb Add new eager formatting API 2026-03-06 18:52:11 +01:00
Jonathan Brouwer 03a8ae8b11 Rollup merge of #153483 - aytey:dyn_paren_impl_fn_return, r=fmease
Preserve parentheses around `Fn` trait bounds in pretty printer

The AST pretty printer was dropping parentheses around `Fn` trait bounds in `dyn`/`impl` types when additional `+` bounds were present. For example:

    dyn (FnMut(&mut T) -> &mut dyn ResourceLimiter) + Send + Sync

was pretty-printed as:

    dyn FnMut(&mut T) -> &mut dyn ResourceLimiter + Send + Sync

Without parens, `+ Send + Sync` binds to the inner `dyn ResourceLimiter` instead of the outer type, producing invalid Rust.

The parser already tracks parentheses via `PolyTraitRef.parens`, but `print_poly_trait_ref` never checked this field. This adds `popen()` and `pclose()` calls when `parens == Parens::Yes`.
2026-03-06 18:49:52 +01:00
Jonathan Brouwer 6a0082008c Rollup merge of #153476 - DanielEScherzer:patch-2, r=bjorn3
bootstrap.py: fix typo "parallle"
2026-03-06 18:49:51 +01:00
Jonathan Brouwer 69dc318464 Rollup merge of #153452 - GuillaumeGomez:migrate-diag, r=JonathanBrouwer
Cleanup unused diagnostic emission methods

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

To remove `lint_level`, we need to remove all functions calling it. One of them is `TyCtxt::node_span_lint`, so removing it.

r? @JonathanBrouwer
2026-03-06 18:49:51 +01:00
Jonathan Brouwer bdaa0481d6 Rollup merge of #153445 - ia0:overflow_try, r=ytmimi
Consider try blocks as block-like for overflowed expr

The tracking issue for `try_blocks` is https://github.com/rust-lang/rust/issues/31436.
The tracking issue for `try_blocks_heterogeneous` is https://github.com/rust-lang/rust/issues/149488.

Fixes https://github.com/rust-lang/rustfmt/issues/6799.
2026-03-06 18:49:50 +01:00
Jonathan Brouwer 06b411cede Rollup merge of #153230 - jieyouxu:rustfmt-reviewers-for-rustfmt, r=ytmimi
Roll rustfmt reviewers for in-tree rustfmt

Noticed in https://github.com/rust-lang/rust/pull/153229#issuecomment-3977482140, where because `src/tools/rustfmt` has no corresponding `[assign.owners]` entry, it rolls one of the `fallback` reviewers (Mark and me) which is needless indirection, since if it rolls to Mark, Mark will have to reroll again.

This _can_ also be

```toml
"/src/tools/rustfmt" = ["rustfmt", "rustfmt-contributors"]
```

which corresponds to https://github.com/orgs/rust-lang/teams/rustfmt and https://github.com/orgs/rust-lang/teams/rustfmt-contributors respectively. I will double-check with triagebot team if we can use review rotation toggles for `rust-lang/rust` in-tree `rustfmt` specifically.

Discussion: [#t-rustfmt > review queue tracking for rust-lang/rust in-tree rustfmt](https://rust-lang.zulipchat.com/#narrow/channel/357797-t-rustfmt/topic/review.20queue.20tracking.20for.20rust-lang.2Frust.20in-tree.20rustfmt/with/576498516)

### Unresolved question

- ~~Do we want to start everyone off as off-rotation? Or on-rotation? I plan to start conservatively by preserving existing effective status, which is everyone off-rotation.~~ We will match existing defaults, with everyone starting off as off-team-rotation.

r? @ytmimi
2026-03-06 18:49:50 +01:00
Jonathan Brouwer 56c8de6364 Rollup merge of #153189 - JayanAXHF:refactor/check_attrs_reftor_1, r=JonathanBrouwer
refactor: move `check_align` to `parse_alignment`

Part of rust-lang/rust#153101

r? @JonathanBrouwer

PS: jonathan i'm not sure about what to do with `check_align` now
2026-03-06 18:49:49 +01:00
Jonathan Brouwer 6be5b25aa9 Rollup merge of #152741 - arferreira:fix-invalid-suggestions-destructuring-drop, r=estebank,Kivooeo
Suppress invalid suggestions in destructuring assignment

Fixes rust-lang/rust#152694

When destructuring assignment hits a type with `Drop`, the compiler was emitting two broken suggestions: `ref *&mut String::new()` (invalid syntax) and `.clone()` on a temporary (useless).

Root cause: the suggestion logic didn't know these bindings were synthetic from assign desugaring. The fix reuses the existing `AssignDesugar` detection in `BindingFinder` to collect those spans and skip both suggestions.
2026-03-06 18:49:49 +01:00
Jonathan Brouwer 946e0f4924 Rollup merge of #152040 - JohnTitor:issue-151631, r=BoxyUwU
Do not emit ConstEvaluatable goals if type-const

Fixes rust-lang/rust#151631, fixes rust-lang/rust#151477
r? @fmease

I'd recommend reviewing commit-by-commit, the diff is less-readable to address a cyclic issue.
2026-03-06 18:49:48 +01:00
Jonathan Brouwer ac9bd09ec6 Rollup merge of #153495 - TaKO8Ki:fix-153236-offset-of-recovery, r=petrochenkov
Fix ICE in `offset_of!` error recovery

Fixes rust-lang/rust#153236.

`offset_of!` was changed in rust-lang/rust#148151 to lower through THIR as a sum of calls to the `offset_of` intrinsic. In the error-recovery case, when no valid field indices are recorded, that lowering synthesized `0` as a `u32` even though the overall `offset_of!` expression has type `usize`.

On 64-bit targets, const-eval then tried to write a 4-byte immediate into an 8-byte destination, which caused the ICE.
2026-03-06 18:49:48 +01:00
Jonathan Brouwer 6b42067e18 Rollup merge of #153485 - RalfJung:float-macros-const, r=tgross35
libcore float tests: replace macro shadowing by const-compatible macro

This lets us avoid https://github.com/rust-lang/rust/issues/153478.
However this means we generate 3 function items per assertion -- or rather, 3*8, since every assertion gets duplicated 8 times (4 float types, each in a const and a non-const variant). That's a lot; is it enough to be concerned about?
coretest already takes forever to build. In a quick test, build time increased from 29.8s to 30.8s, but that may also entirely be noise.

r? @tgross35
2026-03-06 18:49:48 +01:00
Jonathan Brouwer 4e50a44530 Rollup merge of #153174 - Trivo25:fix-wasm64-sync-cfg, r=joboet
std: add wasm64 to sync::Once and thread_parking atomics cfg guards

When targeting `wasm64-unknown-unknown` with atomics enabled, `std::sync::Once` and `thread_parking` fall through to the `no_threads`/`unsupported` implementations because the cfg guards only check for `wasm32`. This causes worker threads to panic with `unreachable` at runtime. The underlying futex implementations already handle both wasm32 and wasm64 correctly, only the cfg guards were missing wasm64.

I tested this manually with a multithreaded wasm64 application ([o1js](https://github.com/o1-labs/o1js/)) compiled with `-Z build-std=panic_abort,std` and `-C target-feature=+atomics,+bulk-memory,+mutable-globals`

Related: rust-lang/rust#83879 rust-lang/rust#77839

Happy to adjust anything based on feedback
2026-03-06 18:49:47 +01:00
Jonathan Brouwer 77658bcda3 Rollup merge of #152593 - spirali:valtreekind-list, r=lcnr
Box in `ValTreeKind::Branch(Box<[I::Const]>)` changed to `List`

This is related to trait system refactoring. It fixes the FIXME in `ValTreeKind`

```
   // FIXME(mgca): Use a `List` here instead of a boxed slice
    Branch(Box<[I::Const]>),
```

It introduces `Interner::Consts`, changes `Branch(Box<[I::Const]>)` to `Branch(I::Consts)`, and updates all relevant places.

r? lcnr
2026-03-06 18:49:47 +01:00
Jonathan Brouwer 550527989e Rollup merge of #151280 - chenyukang:yukang-fix-149787, r=estebank
Fix incorrect trailing comma suggested in no_accessible_fields

Fixes rust-lang/rust#149787

r? @estebank

I think add new field for AST for it is too heavy change for this issue, here is a trivial fix with source_map, seems enough for it.
2026-03-06 18:49:46 +01:00
Jonathan Brouwer bcdb01dccc Rollup merge of #153466 - lnicola:sync-from-ra, r=lnicola
`rust-analyzer` subtree update

Subtree update of `rust-analyzer` to https://github.com/rust-lang/rust-analyzer/commit/0dc60977271e9e994232fc8a17d099803f1a1813.

Created using https://github.com/rust-lang/josh-sync.

r? @ghost
2026-03-06 18:49:45 +01:00
Jonathan Brouwer 46cedc33b8 Use eager formatting in #[derive(Subdiagnostic)] 2026-03-06 18:32:54 +01:00
Waffle Lapkin 05174fbcc5 tidy never type issue-* tests 2026-03-06 17:44:18 +01:00
Guillaume Gomez e01a7e7ba1 Fix panic by setting the span before it is actually needed 2026-03-06 16:38:53 +01:00
bjorn3 15e839e006 Fallback to fat LTO for -Clto=thin in cg_gcc
Fallback to no LTO doesn't work in practice as Cargo asks rustc to
produce LTO-only rlibs with -Clinker-plugin-lto without providing any
indication if they will be used for thin or fat LTO, so we can't disable
-Clinker-plugin-lto for ThinLTO when using cg_gcc.
2026-03-06 15:22:17 +00:00
bors a3ac2f21b3 Auto merge of #153449 - flip1995:clippy-subtree-update, r=Manishearth
Clippy subtree update

r? Manishearth 

Cargo.lock update due to Clippy version bump.
2026-03-06 14:41:17 +00:00
Jonathan Brouwer 8d96e603b1 Preserve the DiagLocation in diag_lint_level 2026-03-06 15:15:43 +01:00
Takayuki Maeda e62f17cfc4 use try_from_target_usize instead of try_from_uint 2026-03-06 22:31:01 +09:00
Takayuki Maeda ed12fe81b0 fix ICE in offset_of! error recovery 2026-03-06 22:19:23 +09:00
Takayuki Maeda ca2178dd9f add UI regression test for offset_of! recovery 2026-03-06 22:19:11 +09:00
Yuki Okushi 1190845a3d Do not emit ConstEvaluatable goals if type-const 2026-03-06 21:51:31 +09:00
Ralf Jung 0fd3ac4c97 libcore float tests: replace macro shadowing by const-compatible macro 2026-03-06 12:07:25 +01:00
Andrew V. Teylu cb66c85555 Preserve parentheses around Fn trait bounds in pretty printer
The AST pretty printer was dropping parentheses around `Fn` trait
bounds in `dyn`/`impl` types when additional `+` bounds were present.
For example:

    dyn (FnMut(&mut T) -> &mut dyn ResourceLimiter) + Send + Sync

was pretty-printed as:

    dyn FnMut(&mut T) -> &mut dyn ResourceLimiter + Send + Sync

Without parens, `+ Send + Sync` binds to the inner `dyn ResourceLimiter`
instead of the outer type, producing invalid Rust.

The parser already tracks parentheses via `PolyTraitRef.parens`, but
`print_poly_trait_ref` never checked this field. This adds `popen()`
and `pclose()` calls when `parens == Parens::Yes`.

Signed-off-by: Andrew V. Teylu <andrew.teylu@vector.com>
2026-03-06 10:38:47 +00:00
bors ff086354c9 Auto merge of #153316 - nnethercote:rm-with_related_context, r=oli-obk
Remove `tls::with_related_context`.

This function gets the current `ImplicitCtxt` and checks that its `tcx` matches the passed-in `tcx`. It's an extra bit of sanity checking: when you already have a `tcx`, and you need access to the non-`tcx` parts of `ImplicitCtxt`, check that your `tcx` matches the one in `ImplicitCtxt`.

However, it's only used in two places: `start_query` and `current_query_job`. The non-checked alternatives (`with_context`, `with_context_opt`) are used in more places, including some where a `tcx` is available. And things would have to go catastrophically wrong for the check to fail -- e.g. if we somehow end up with multiple `TyCtxt`s. In my opinion it's just an extra case to understand in `tls.rs` that adds little value.

This commit removes it. This avoids the need for `tcx` parameters in a couple of places. The commit also adjusts how `start_query` sets up its `ImplicitCtxt` to more closely match how similar functions do it, i.e. with `..icx.clone()` for the unchanged fields.

r? @oli-obk
2026-03-06 10:21:32 +00:00
Florian 6a950e74b7 add wasm64 to sync::Once and thread_parking atomics cfg guard
Update library/std/src/sys/sync/once/mod.rs

Update library/std/src/sys/sync/thread_parking/mod.rs

Co-Authored-By: Taiki Endo <te316e89@gmail.com>
2026-03-06 13:15:05 +03:00
Jynn Nelson 20404bf4a6 Split out linker-info from linker-messages
- Hide common linker output behind `linker-info`
- Add tests
- Account for different capitalization on windows-gnu when removing
  "warning" prefix
- Add some more comments
- Add macOS deployment-target test
- Ignore linker warnings from trying to statically link glibc

  I don't know what's going on in `nofile-limit.rs` but I want no part
  of it.

- Use a fake linker so tests are platform-independent
2026-03-06 10:38:21 +01:00
Daniel Scherzer a62c6717ff bootstrap.py: fix typo "parallle" 2026-03-05 23:39:05 -08:00
Laurențiu Nicola 80af4486c7 Merge pull request #21763 from lnicola/lockfile-beta
Tweak pre-release check for beta
2026-03-06 05:28:27 +00:00
Laurențiu Nicola 006929f1e6 Tweak pre-release check for beta 2026-03-06 07:18:44 +02:00
bors f824853889 Auto merge of #153429 - weihanglo:update-cargo, r=weihanglo
Update cargo submodule



12 commits in f298b8c82da0cba538516b45b04a480fc501d4c0..90ed291a50efc459e0c380d7b455777ed41c6799
2026-02-24 21:59:20 +0000 to 2026-03-05 15:11:25 +0000
- test(git): Mark a test as non-deterministic (rust-lang/cargo#16706)
- Docs: Clarify build script current directory (rust-lang/cargo#16703)
- test(replace): Mark a test as non-deterministic (rust-lang/cargo#16700)
- chore: bump to 0.97.0; update changelog (rust-lang/cargo#16699)
- fix(tests): allow for 'could not' as well as couldn't in test output (rust-lang/cargo#16698)
- chore: Upgrade dependencies (rust-lang/cargo#16690)
- chore(deps): update crate-ci/typos action to v1.44.0 (rust-lang/cargo#16685)
- feat(help): display manpage for nested commands (rust-lang/cargo#16432)
- feat: improve parent workspace search error msg (rust-lang/cargo#16669)
- feat(fix): Inject an edition into scripts (rust-lang/cargo#16678)
- fix(toml): Clarify the edition is on the float (rust-lang/cargo#16676)
- fix(toml): show required rust-version in unstable edition error (rust-lang/cargo#16653)
2026-03-06 04:54:57 +00:00