Commit graph

315724 commits

Author SHA1 Message Date
Chayim Refael Friedman
ebcbff2a2e Do not mix the order of builtin/regular derives in "Expand macro recursively" 2026-01-19 04:50:23 +02:00
Lukas Wirth
7bbe9029fb
Merge pull request #21484 from Veykril/push-uoxwkwottnqn
fix: Do not show sysroot dependencies in symbol search
2026-01-18 09:02:34 +00:00
Lukas Wirth
8f129586bf
Merge pull request #21483 from Veykril/push-vswqqvzqyvnv
feat: Trigger flycheck if non-workspace files get modified
2026-01-18 09:02:14 +00:00
Lukas Wirth
bfbee86a2d feat: Trigger flycheck if non-workspace files get modified
Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
Co-authored-by: dino <dinojoaocosta@gmail.com>
2026-01-18 09:53:53 +01:00
Lukas Wirth
cbad6dd117 fix: Do not show sysroot dependencies in symbol search 2026-01-18 09:53:09 +01:00
Laurențiu Nicola
060c6f1691
Merge pull request #21468 from Wilfred/improve_discover_docs
internal: Improve docs for discoverConfig
2026-01-18 07:30:36 +00:00
Shoyu Vanilla (Flint)
c6ec8ea033
Merge pull request #21475 from lukasoyen/fix-flycheck-indexing
fix: lookup flycheck by ID instead of vector index
2026-01-16 07:29:24 +00:00
lummax
d859656349 fix: lookup flycheck by ID instead of vector index
After a recent introduction of per-package flycheck for JSON projects, the code
assumed that `world.flycheck` indices matched `world.workspaces` indices.
However, not all workspaces have flycheck enabled (e.g., JSON projects
without a flycheck template configured), so the flycheck vector can be
shorter than the workspaces vector.

This caused an index-out-of-bounds panic when saving a file in a JSON
project without flycheck configured:

  thread 'Worker' panicked at notification.rs:
  index out of bounds: the len is 0 but the index is 0

Fix by looking up the flycheck handle by its ID (which is the workspace
index set during spawn) rather than using the workspace index directly
as a vector index.
2026-01-15 12:56:01 +01:00
Shoyu Vanilla (Flint)
70f4111d67
Merge pull request #21465 from A4-Tacks/prec-cast-before-angle
Fix false positive precedence in `(2 as i32) < 3`
2026-01-15 09:09:18 +00:00
Laurențiu Nicola
5c1acd6ad1
Merge pull request #21471 from rust-lang/rustc-pull
minor: Rustc pull update
2026-01-15 06:49:20 +00:00
The rustc-josh-sync Cronjob Bot
52159b6fbb Merge ref 'b6fdaf2a15' from rust-lang/rust
Pull recent changes from https://github.com/rust-lang/rust via Josh.

Upstream ref: rust-lang/rust@b6fdaf2a15
Filtered ref: rust-lang/rust-analyzer@21d86db301
Upstream diff: 44a5b55557...b6fdaf2a15

This merge was created using https://github.com/rust-lang/josh-sync.
2026-01-15 04:22:02 +00:00
Usman Akinyemi
54fc546f20 Recover from struct literals with placeholder or empty path
Based on earlier work by León Orell Valerian Liehr.

Co-authored-by: León Orell Valerian Liehr <me@fmease.dev>
Signed-off-by: Usman Akinyemi <uniqueusman@archlinux>
2026-01-26 04:09:28 +05:30
bors
7704328ba5 Auto merge of #151158 - Zalathar:rollup-okXJcXA, r=Zalathar
Rollup of 4 pull requests

Successful merges:

 - rust-lang/rust#150846 (include `HirId`s directly in the THIR, not wrapped in `LintLevel`s)
 - rust-lang/rust#150979 (Avoid ICEs after bad patterns, for the other syntactic variants)
 - rust-lang/rust#151103 (mir_build: Simplify length-determination and indexing for array/slice patterns)
 - rust-lang/rust#151130 (resolve: Downgrade `ambiguous_glob_imports` to warn-by-default)

r? @ghost
2026-01-15 12:33:17 +00:00
Stuart Cook
256722639d
Rollup merge of #151130 - diesel2, r=lqd
resolve: Downgrade `ambiguous_glob_imports` to warn-by-default

But still keep it report-in-deps, as decided in https://github.com/rust-lang/rust/issues/149845#issuecomment-3750423840.

This will need to be reverted after ~February 27 2026, when Rust 1.95 branches out from the main branch.

Closes https://github.com/rust-lang/rust/issues/149845.
2026-01-15 21:39:04 +11:00
Stuart Cook
69f0a498ba
Rollup merge of #151103 - array-pat-len, r=Nadrieril,petrochenkov
mir_build: Simplify length-determination and indexing for array/slice patterns

The existing length-determination code in `prefix_slice_suffix` has ended up overly complicated, partly because it doesn't know in advance whether the pattern is supposed to be an array pattern or a slice pattern.

Pulling most of that step out into the `PatKind::Array` arm makes the whole thing a bit nicer overall.

There should (hopefully) be no change to compiler output. The biggest “functional” change is that we now discard the subpatterns of an array pattern of unknowable length, instead of treating it as a slice pattern. I'm not aware of any way for this to make an observable difference, and it can only occur when compilation is already doomed to fail.
2026-01-15 21:39:03 +11:00
Stuart Cook
9682509bdb
Rollup merge of #150979 - typeck-pat, r=lcnr
Avoid ICEs after bad patterns, for the other syntactic variants

This PR introduces changes equivalent to the ones in rust-lang/rust#126320, but also for struct and tuple patterns, instead of tuple struct patterns only.

Fixes rust-lang/rust#150507.
2026-01-15 21:39:03 +11:00
Stuart Cook
eafe40e05c
Rollup merge of #150846 - thir-hir-id, r=lcnr
include `HirId`s directly in the THIR, not wrapped in `LintLevel`s

Occurrences of `LintLevel` in the THIR were always `LintLevel::Explicit`, containing a `HirId`, so we don't need to make it possible to put `LintLevel::Inherited` there. Removing the unused case where `HirId`s aren't present in the THIR slightly simplifies diagnostics/lints/tools that want to map from the THIR back to the HIR, e.g. rust-lang/rust#145569.

Since `LintLevel` is no longer present in the THIR, I've moved it in the second commit to live in `rustc_mir_build`; that's where it's actually used. I'm not sure exactly where exactly it should live there, but I put it in the `builder::scope` module since it's used by `Builder::in_scope` for determining when to introduce source scopes.

r? lcnr as the reviewer of rust-lang/rust#145569, since this was discussed there
2026-01-15 21:39:02 +11:00
Vadim Petrochenkov
cd05071ec4 resolve: Downgrade ambiguous_glob_imports to warn-by-default
But still keep it report-in-deps.

To revert after ~February 27 2026, when Rust 1.95 branches out from the main branch.
2026-01-15 13:02:20 +03:00
bors
a6acf0f07f Auto merge of #150772 - Kobzol:remove-bors-build-finished, r=jieyouxu
Change `bors build finished` job to `publish toolstate`

Due to recent advancements in merge queue bot technology, we no longer need this job. We still use a simpler job to publish the toolstate on `auto` builds though.

Should be merged once we get rid of homu.
2026-01-15 06:29:26 +00:00
The rustc-josh-sync Cronjob Bot
c31add0387 Prepare for merging from rust-lang/rust
This updates the rust-version file to b6fdaf2a15.
2026-01-15 04:21:53 +00:00
bors
c9af9c1dc8 Auto merge of #151151 - Zalathar:rollup-kAQYrsB, r=Zalathar
Rollup of 2 pull requests

Successful merges:

 - rust-lang/rust#151150 (Revert "avoid phi node for pointers flowing into Vec appends rust-lang/rust#130998")
 - rust-lang/rust#151145 (Reduce rustdoc GUI flakyness, take 2)

r? @ghost
2026-01-15 03:13:06 +00:00
Stuart Cook
d87e654be9
Rollup merge of #151145 - reduce-rustdoc-flakyness, r=jieyouxu
Reduce rustdoc GUI flakyness, take 2

Fixes https://github.com/rust-lang/rust/issues/151006 (hopefully).

Seems like https://github.com/rust-lang/rust/pull/151053 did not fix the flakyness issue, so here is another take on this issue.

r? @jieyouxu
2026-01-15 14:10:21 +11:00
Stuart Cook
11b00792ba
Rollup merge of #151150 - revert-vec-append, r=Zalathar
Revert "avoid phi node for pointers flowing into Vec appends #130998"

This reverts PR rust-lang/rust#130998 because the added test seems to be flaky / non-deterministic, and has been failing in unrelated PRs during merge CI:

- https://github.com/rust-lang/rust/pull/151129#issuecomment-3751597908
- https://github.com/rust-lang/rust/pull/150772#issuecomment-3751696578
- https://github.com/rust-lang/rust/pull/150925#issuecomment-3752431118
- https://github.com/rust-lang/rust/pull/151145#issuecomment-3752500686

See also [#t-infra > Tree ops](https://rust-lang.zulipchat.com/#narrow/channel/242791-t-infra/topic/Tree.20ops/with/568111767).

> [!NOTE]
>
> This is a "fallback" PR in case the FileCheck failure isn't obvious (i.e. fix-forward). This PR reverts rust-lang/rust#130998 wholesale in case the failure is genuine and indicative of a bug in the actual implementation change.
2026-01-15 14:10:21 +11:00
Jieyou Xu
cd79ff2e2c
Revert "avoid phi node for pointers flowing into Vec appends #130998"
This reverts PR <https://github.com/rust-lang/rust/pull/130998> because
the added test seems to be flaky / non-deterministic, and has been
failing in unrelated PRs during merge CI.
2026-01-15 09:37:16 +08:00
dianne
8868b479a8 move LintLevel to rustc_mir_build 2026-01-14 14:25:21 -08:00
dianne
36d37fd11b THIR: directly contain HirIds, not LintLevels 2026-01-14 14:25:21 -08:00
Guillaume Gomez
4bacdf7b8b Reduce rustdoc GUI flakyness, take 2 2026-01-14 22:47:53 +01:00
bors
b6fdaf2a15 Auto merge of #151144 - JonathanBrouwer:rollup-QW4Ug5q, r=JonathanBrouwer
Rollup of 15 pull requests

Successful merges:

 - rust-lang/rust#150585 (Add a context-consistency check before emitting redundant generic-argument suggestions)
 - rust-lang/rust#150586 (rustdoc: Fix intra-doc link bugs involving type aliases and associated items)
 - rust-lang/rust#150590 (Don't try to recover keyword as non-keyword identifier )
 - rust-lang/rust#150817 (cleanup: remove borrowck handling for inline const patterns)
 - rust-lang/rust#150939 (resolve: Relax some asserts in glob overwriting and add tests)
 - rust-lang/rust#150962 (Remove `FeedConstTy` and provide ty when lowering const arg)
 - rust-lang/rust#150966 (rustc_target: Remove unused Arch::PowerPC64LE)
 - rust-lang/rust#150971 (Disallow eii in statement position)
 - rust-lang/rust#151016 (fix: WASI threading regression by disabling pthread usage)
 - rust-lang/rust#151046 (compiler: Make Externally Implementable Item (eii) macros "semiopaque")
 - rust-lang/rust#151099 (Recover parse gracefully from `<const N>`)
 - rust-lang/rust#151117 (Avoid serde dependency in build_helper when not necessary)
 - rust-lang/rust#151127 (Delete `MetaItemOrLitParser::Err`)
 - rust-lang/rust#151128 (Add temporary new bors e-mail address to the mailmap)
 - rust-lang/rust#151138 (Rename `rust.use-lld` to `rust.bootstrap-override-lld` in INSTALL.md)

r? @ghost
2026-01-14 21:30:22 +00:00
Jonathan Brouwer
4523c2eff4
Rollup merge of #151138 - fix-install-lld, r=Kobzol
Rename `rust.use-lld` to `rust.bootstrap-override-lld` in INSTALL.md

I was trying to follow the example configure command in `INSTALL.md` and found that it gives error after `rust.use-lld` is renamed by 852aa20c90.
2026-01-14 22:30:01 +01:00
Jonathan Brouwer
1a1056ff76
Rollup merge of #151128 - new-bors-mailmap, r=lqd
Add temporary new bors e-mail address to the mailmap

To match it to bors in thanks.
2026-01-14 22:30:01 +01:00
Jonathan Brouwer
c7f7c3fc21
Rollup merge of #151127 - delete_variant, r=JonathanBrouwer
Delete `MetaItemOrLitParser::Err`

This variant is never constructed.
2026-01-14 22:30:00 +01:00
Jonathan Brouwer
92737cab34
Rollup merge of #151117 - reduce_deps, r=Kobzol
Avoid serde dependency in build_helper when not necessary

Run-make-support doesn't need the metrics code to be pulled in ever. And bootstrap only needs it in CI where build metrics support is enabled.
2026-01-14 22:30:00 +01:00
Jonathan Brouwer
00501de1c8
Rollup merge of #151099 - issue-84327-2, r=fmease
Recover parse gracefully from `<const N>`

When a const param doesn't have a `: Type`, recover the parser state and provide a structured suggestion. This not only provides guidance on what was missing, but it also makes subsuequent errors to be emitted that would otherwise be silenced.

```
error: expected `:`, found `>`
  --> $DIR/incorrect-const-param.rs:26:16
   |
LL | impl<T, const N> From<[T; N]> for VecWrapper<T>
   |                ^ expected `:`
   |
help: you might have meant to write the type of the const parameter here
   |
LL | impl<T, const N: /* Type */> From<[T; N]> for VecWrapper<T>
   |                ++++++++++++
```

r? @fmease

Follow up to rust-lang/rust#151077. Fix rust-lang/rust#84327.
2026-01-14 22:30:00 +01:00
Jonathan Brouwer
daae6601be
Rollup merge of #151046 - semiopaque-eii-fix, r=jdonszelmann
compiler: Make Externally Implementable Item (eii) macros "semiopaque"

Otherwise eiis defined by std will produce large amounts of `missing stability attribute` errors. This problem is not eii specific, as can be seen in https://github.com/rust-lang/rust/issues/146993 and which is demonstrated in https://github.com/rust-lang/rust/pull/151022.

As can be seen with

```console
$ git grep rustc_macro_transparency
compiler/rustc_arena/src/lib.rs:#[rustc_macro_transparency = "semiopaque"]
[...]
```

it is very common for macros to use `"semiopaque"`.

r? @jdonszelmann

Tracking issue: https://github.com/rust-lang/rust/issues/125418

Needed for: https://github.com/rust-lang/rust/issues/150588
2026-01-14 22:29:59 +01:00
Jonathan Brouwer
2c17e0e110
Rollup merge of #151016 - fix_wasi_threading, r=alexcrichton
fix: WASI threading regression by disabling pthread usage

PR rust-lang/rust#147572 changed WASI to use the Unix threading implementation, but WASI does not support threading. When the Unix code tries to call pthread_create, it fails with EAGAIN, causing libraries like rayon to panic when trying to initialize their global thread pool.

The old wasip1/wasip2 implementations:
- wasip1: Threading conditionally available with atomics (experimental)
- wasip2: Threading unconditionally unsupported

This fix restores that behavior by disabling pthread-based threading for all WASI targets:
1. Guard the pthread-based Thread implementation with #[cfg(not(target_os = "wasi"))]
2. Provide an unsupported stub (Thread(!)) for WASI
3. Return Err(io::Error::UNSUPPORTED_PLATFORM) when Thread::new is called

Fixes the regression where rayon-based code (e.g., lopdf in PDF handling) panicked on WASI after nightly-2025-12-10.

Before fix:
  pthread_create returns EAGAIN (error code 6)
  ThreadPoolBuildError { kind: IOError(Os { code: 6,
  kind: WouldBlock, message: "Resource temporarily unavailable" }) }

After fix:
  Thread::new returns Err(io::Error::UNSUPPORTED_PLATFORM)
  Libraries can gracefully handle the lack of threading support

r? @alexcrichton
2026-01-14 22:29:58 +01:00
Jonathan Brouwer
46d4bbf6df
Rollup merge of #150971 - disallow-eii-in-statement-position, r=wafflelapkin
Disallow eii in statement position

With how v2 macros resolve, and the name resolution of `super` works, I realized with @WaffleLapkin that there's actually no way to consistently expand EIIs in statement position.

r? @WaffleLapkin
2026-01-14 22:29:58 +01:00
Jonathan Brouwer
d23e780a57
Rollup merge of #150966 - arch-powerpc64le, r=petrochenkov
rustc_target: Remove unused Arch::PowerPC64LE

This variant has been added in https://github.com/rust-lang/rust/pull/147645, but actually unused since target_arch for powerpc64le- targets is "powerpc64". (The difference between powerpc64- and powerpc64le- targets is identified by target_endian.)

Note: This is an internal cleanup and does NOT remove `powerpc64le-*` targets.
2026-01-14 22:29:57 +01:00
Jonathan Brouwer
27e6ef9f6d
Rollup merge of #150962 - rm/feed_const_ty, r=BoxyUwU
Remove `FeedConstTy` and provide ty when lowering const arg

r? @BoxyUwU

edit: BoxyUwU

`FeedConstTy` currently only provides the expected type of a const argument *sometimes* (e.g. previously array lengths did not do this). This causes problems with mGCA's directly represented const arguments which always need to know their expected type.
2026-01-14 22:29:57 +01:00
Jonathan Brouwer
6cdcef5454
Rollup merge of #150939 - impasse, r=estebank
resolve: Relax some asserts in glob overwriting and add tests

Fixes https://github.com/rust-lang/rust/issues/150927.
Fixes https://github.com/rust-lang/rust/issues/150928.
Fixes https://github.com/rust-lang/rust/issues/150929.
Fixes https://github.com/rust-lang/rust/issues/150976.
Fixes https://github.com/rust-lang/rust/issues/150977.
Fixes https://github.com/rust-lang/rust/issues/151008.
Fixes https://github.com/rust-lang/rust/issues/151037.
Fixes https://github.com/rust-lang/rust-clippy/issues/16398.
r? @yaahc
2026-01-14 22:29:57 +01:00
Jonathan Brouwer
7cab643461
Rollup merge of #150817 - cleanup-inline-const-pat-borrowck, r=lcnr
cleanup: remove borrowck handling for inline const patterns

rust-lang/rust#120390 added borrow-checking for inline const patterns; a type annotation was added to inline const patterns in the THIR to remember the `DefId` and args of the constants so they could be checked and constraints could be propagated to their parents. As of rust-lang/rust#138499 though, inline const patterns can't be borrow-checked due to a query cycle, and as of rust-lang/rust#149667, the type/`DefId`/args annotations on inline const patterns have been removed, so the borrowck code for them seems unused; this PR removes it.

In a hypothetical future where borrowck doesn't depend on exhaustiveness checking so `inline_const_pat` can be reinstated, I imagine we also won't be evaluating inline const patterns before borrowck. As such, we might be able to reuse the existing code for normal unevaluated inline const operands in [`TypeChecker::visit_operand`](32fe406b5e/compiler/rustc_borrowck/src/type_check/mod.rs (L1720-L1749)) (or at least we shouldn't need to encode inline const patterns' `DefId` and args in user type annotations if they appear directly in the MIR).

r? lcnr
2026-01-14 22:29:56 +01:00
Jonathan Brouwer
9ef76797ea
Rollup merge of #150590 - ident-kw-ice, r=petrochenkov
Don't try to recover keyword as non-keyword identifier

Fixes rust-lang/rust#149692.

On beta after rust-lang/rust#146978, we ICE on

```rs
macro_rules! m {
    ($id:item()) => {}
}

m!(Self());
```

where `Self` in the macro invocation is a keyword not a "normal" identifier, while attempting to recover an missing keyword before an identifier. Except, `Self` *is* a keyword, so trying to parse that as a non-reserved identifier expectedly fails.

I suspect rust-lang/rust#146978 merely unmasked a possible code path to hit this case; this logic has been so for a good while. Previously, on stable, the error message looks something like

```rs
error: expected identifier, found keyword `Self`
 --> src/lib.rs:5:4
  |
5 | m!(Self());
  |    ^^^^ expected identifier, found keyword

error: missing `fn` or `struct` for function or struct definition
 --> src/lib.rs:5:4
  |
2 |     ($id:item()) => {}
  |      -------- while parsing argument for this `item` macro fragment
...
5 | m!(Self());
  |    ^^^^
  |
help: if you meant to call a macro, try
  |
5 | m!(Self!());
  |        +
```

I considered restoring this diagnostic, but I'm not super convinced it's worth the complexity (and to me, it's not super clear what the user actually intended here).
2026-01-14 22:29:56 +01:00
Jonathan Brouwer
e04af73628
Rollup merge of #150586 - intra-doc-assoc-alias, r=GuillaumeGomez
rustdoc: Fix intra-doc link bugs involving type aliases and associated items

This PR:
- Add support for linking to fields of variants behind a type alias.
- Correctly resolve links to fields and variants behind a type alias to the alias's version of the docs.
- Refactor some intra-doc links code to make it simpler.
- Add tests for the status quo of linking to associated items behind aliases.

Future steps:
- Nail down the rules of when inherent and trait impls are inlined into an alias's docs, and when impls on the alias appear for the aliased type.
- Adjust the resolutions of intra-doc links, through aliases, to associated items based on these rules.

r? @GuillaumeGomez
2026-01-14 22:29:55 +01:00
Jonathan Brouwer
a496d1de66
Rollup merge of #150585 - issue-149559, r=petrochenkov
Add a context-consistency check before emitting redundant generic-argument suggestions

Fixes rust-lang/rust#149559

Add a context-consistency check before emitting redundant generic-argument suggestions. If the redundant argument spans come from mixed hygiene contexts (e.g., macro definition + macro callsite), we skip the suggestion to avoid malformed `shrink_to_hi().to(...)` spans and potential ICEs.
2026-01-14 22:29:55 +01:00
Zijie Zhao
436fb87eeb
Rename rust.use-lld to rust.bootstrap-override-lld in INSTALL.md 2026-01-14 14:20:45 -06:00
Laurențiu Nicola
77f372f75f
Merge pull request #21467 from robertoaloi/ra-upgrade
Bump camino to 1.2.2
2026-01-14 19:58:13 +00:00
Maja Kądziołka
1028c7a66a Avoid ICEs after bad patterns, for the other syntactic variants 2026-01-14 20:54:27 +01:00
Wilfred Hughes
6ecee2a415 internal: Improve docs for discoverConfig
Add concrete examples of CLI invocations and JSONL outputs, use BUCK
for consistency with the first example, and polish the wording.
2026-01-14 18:27:45 +00:00
Esteban Küber
92db7b2b5a Recover parse gracefully from <const N>
When a const param doesn't have a `: Type`, recover the parser state and provide a structured suggestion. This not only provides guidance on what was missing, but it also makes subsuequent errors to be emitted that would otherwise be silenced.

```
error: expected `:`, found `>`
  --> $DIR/incorrect-const-param.rs:26:16
   |
LL | impl<T, const N> From<[T; N]> for VecWrapper<T>
   |                ^ expected `:`
   |
help: you might have meant to write the type of the const parameter here
   |
LL | impl<T, const N: /* Type */> From<[T; N]> for VecWrapper<T>
   |                ++++++++++++
```
2026-01-14 17:56:31 +00:00
Jakub Beránek
9f1cf9efe0
Add temporary new bors e-mail address to the mailmap
To match it to bors in thanks.
2026-01-14 18:01:50 +01:00
Vadim Petrochenkov
83c5f2c194 resolve: Relax one more assert in glob overwriting and add a test
Also avoid losing some glob ambiguities when re-fetching globs
2026-01-14 19:58:40 +03:00