Commit Graph

320612 Commits

Author SHA1 Message Date
Lukas Wirth e1e83b3eae Merge pull request #21788 from Veykril/push-mwqrzolksvxx
Do not re-query source roots per crate in analysis-stats
2026-03-09 10:18:14 +00:00
Lukas Wirth 1675674072 Do not re-query source roots per crate in analysis-stats 2026-03-09 11:08:57 +01:00
Laurențiu Nicola bd1ba78364 Merge pull request #21786 from rust-lang/rustc-pull
minor: sync from downstream
2026-03-09 08:32:23 +00:00
Lukas Wirth aae1f07141 Merge pull request #21785 from ChayimFriedman2/dup-assoc-res
fix: Allow duplicate assoc type shorthand resolution if it points to the same assoc type
2026-03-09 07:58:26 +00:00
Lukas Wirth eba0a642a9 Merge pull request #21767 from Veykril/push-xxyxurxwwmvy
Remove crate from salsa `EditionedFileId`
2026-03-09 07:57:57 +00:00
The rustc-josh-sync Cronjob Bot e9119985cd Merge ref 'eda4fc7733ee' from rust-lang/rust
Pull recent changes from https://github.com/rust-lang/rust via Josh.

Upstream ref: rust-lang/rust@eda4fc7733
Filtered ref: rust-lang/rust-analyzer@18005ba4c5
Upstream diff: https://github.com/rust-lang/rust/compare/f8704be04fe1150527fc2cf21dd44327f0fe87fb...eda4fc7733ee89e484d7120cafbd80dcb2fce66e

This merge was created using https://github.com/rust-lang/josh-sync.
2026-03-09 04:49:02 +00:00
The rustc-josh-sync Cronjob Bot 091f319bcd Prepare for merging from rust-lang/rust
This updates the rust-version file to eda4fc7733.
2026-03-09 04:43:44 +00:00
bors eda4fc7733 Auto merge of #153579 - JonathanBrouwer:rollup-DFWynbC, r=JonathanBrouwer
Rollup of 6 pull requests

Successful merges:

 - rust-lang/rust#152535 (std: use `OnceLock` for Xous environment variables)
 - rust-lang/rust#152646 (Update `UnsafeUnpin` impls involving extern types.)
 - rust-lang/rust#153559 (Inline and simplify some code for saving incremental data to disk)
 - rust-lang/rust#151900 (num: Separate public API from internal implementations)
 - rust-lang/rust#153520 (.mailmap: fix broken line with multiple emails)
 - rust-lang/rust#153573 (rustdoc-json: fix incorrect documentation for VariantKind::Struct)

Failed merges:

 - rust-lang/rust#153509 (Cleanup unused diagnostic emission methods - part 2)
2026-03-09 00:40:10 +00:00
Jonathan Brouwer 934afe30cd Rollup merge of #153573 - yshui-forks:rustdoc-types-doc, r=obi1kenobi,GuillaumeGomez
rustdoc-json: fix incorrect documentation for VariantKind::Struct

Seems to have been copy-and-pasted from `Enum::variants`, but `VariantKind::Struct::fields` is for struct variant fields, not enum variants.
2026-03-08 22:51:54 +01:00
Jonathan Brouwer 9b969739e9 Rollup merge of #153520 - DanielEScherzer:patch-4, r=lolbinarycat
.mailmap: fix broken line with multiple emails

Split binarycat's entry into multiple lines, one for each extra email
2026-03-08 22:51:53 +01:00
Jonathan Brouwer 83e6dbf9e1 Rollup merge of #151900 - tgross35:num-internal-imp, r=Mark-Simulacrum
num: Separate public API from internal implementations

Currently we have a single `core::num` module that contains both thin wrapper API and higher-complexity numeric routines. Restructure this by moving implementation details to a new `imp` module.

This results in a more clean separation of what is actually user-facing compared to items that have a stability attribute because they are public for testing.

The first commit does the actual change then the second moves a portion back.
2026-03-08 22:51:52 +01:00
Jonathan Brouwer 15a6976c86 Rollup merge of #153559 - Zalathar:persist, r=jackh726
Inline and simplify some code for saving incremental data to disk

Main changes:
- Inline `encode_query_cache` and `TyCtxt::serialize_query_result_cache`
- Pull value promotion out of `OnDiskCache::drop_serialized_data`
- Panic if `on_disk_cache` is None in an incremental-only path
2026-03-08 22:51:52 +01:00
Jonathan Brouwer e21a5df27e Rollup merge of #152646 - zachs18:unsafeunpin-marker-impls-pointee, r=Mark-Simulacrum
Update `UnsafeUnpin` impls involving extern types.

`UnsafeUnpin` tracking issue: https://github.com/rust-lang/rust/issues/125735

Relaxes from `T: ?Sized` (i.e. `T: MetaSized`) to `T: PointeeSized` for the `UnsafeUnpin` impls for pointers, references, and `PhantomData<T>`, and for the negative `UnsafeUnpin` impl for `UnsafePinned<T>`. (Compare to the impls for `Freeze` on lines 911-921.)

Both `UnsafeUnpin` and `extern type`s (the only way to have a `!MetaSized` type) are unstable, so this should have no effect on stable code.

Also updates the marker_impls macro docs to use PointeeSized bound, as most uses of the macro now do.

Concretely, this change means that the following types will newly implement `UnsafeUnpin`:

* pointers and references to `T` where `T` is an `extern type`
* `PhantomData<T>` where `T` is an extern type
* either of the above where `T` is a `struct` or tuple with `extern type` tail

Additionally, the negative `UnsafeUnpin` impl for `UnsafePinned<T>` is also relaxed to `T: PointeeSized` to align with the analogous negative `Freeze` impl for `UnsafeCell<T>`, even though both structs have `T: ?Sized` in their declaration (which probably should be relaxed, but that is a separate issue), so this part of the change doesn't actually *do* anything currently, but if `UnsafeCell` and `UnsafePinned` are later relaxed to `T: PointeeSized`, then the negative impl will apply to the newly possible instantiations. Also cc https://github.com/rust-lang/rust/issues/152645 that these impls compile at all.
2026-03-08 22:51:51 +01:00
Jonathan Brouwer 1ef29e7af6 Rollup merge of #152535 - joboet:xous_env_once_lock, r=Mark-Simulacrum
std: use `OnceLock` for Xous environment variables

There's no need for exposed-provenance-shenanigans here...

CC @xobs
2026-03-08 22:51:51 +01:00
Lukas Wirth c597a88a38 Remove crate from salsa EditionedFileId 2026-03-08 19:45:23 +01:00
bors b41f22de2a Auto merge of #153576 - JonathanBrouwer:rollup-oZYO7KY, r=JonathanBrouwer
Rollup of 4 pull requests

Successful merges:

 - rust-lang/rust#153464 (Use `&C::Key` less in queries.)
 - rust-lang/rust#153553 (Remove the `rustc_data_structures::assert_matches!` re-exports)
 - rust-lang/rust#153561 (Replace the `try_mark_green` hook with direct calls to `tcx.dep_graph`)
 - rust-lang/rust#153564 (rendering interpreter OOM as OOM instead of ICE)
2026-03-08 18:05:25 +00:00
Jonathan Brouwer f0defb0de1 Rollup merge of #153564 - RalfJung:oom-is-not-ice, r=oli-obk
rendering interpreter OOM as OOM instead of ICE

Fixes https://github.com/rust-lang/rust/issues/149643.
Alternative to https://github.com/rust-lang/rust/pull/153481.
2026-03-08 19:04:37 +01:00
Jonathan Brouwer 35152ef343 Rollup merge of #153561 - Zalathar:try-mark-green, r=nnethercote
Replace the `try_mark_green` hook with direct calls to `tcx.dep_graph`

All of the existing call sites are directly touching `tcx.dep_graph` anyway, so the extra layer of indirection provides no real benefit.

There should be no change to compiler behaviour.

r? nnethercote (or compiler)
2026-03-08 19:04:37 +01:00
Jonathan Brouwer 11636013f9 Rollup merge of #153553 - Zalathar:assert-matches, r=lqd
Remove the `rustc_data_structures::assert_matches!` re-exports

- https://github.com/rust-lang/rust/pull/151359
- https://github.com/rust-lang/rust/pull/153462
---

Now that the bootstrap stage0 compiler has been bumped to 1.95, we can remove these temporary re-exports from `rustc_data_structures`, and once again import the `assert_matches!` macros directly from std.
2026-03-08 19:04:36 +01:00
Jonathan Brouwer 38108e1e0d Rollup merge of #153464 - nnethercote:less-ref-Key, r=Zalathar
Use `&C::Key` less in queries.

Currently we use a mix of `C::Key` and `&C::Key` parameters. The former is more common and a bit nicer, so convert some of the latter. This results in less converting between the two types, and fewer sigils.
2026-03-08 19:04:36 +01:00
Chayim Refael Friedman b3d440ffdb Allow duplicate assoc type shorthand resolution if it points to the same assoc type
And with the same generic args.
2026-03-08 18:41:51 +02:00
Yuxuan Shui 43e3fd1944 rustdoc-json: fix incorrect documentation for VariantKind::Struct 2026-03-08 15:42:03 +00:00
Ralf Jung 4f48642d1d rendering interpreter OOM as OOM instead of ICE 2026-03-08 13:27:05 +01:00
Nicholas Nethercote face186874 Use &C::Key less in queries.
Currently we use a mix of `C::Key` and `&C::Key` parameters. The former
is more common and a bit nicer, so convert some of the latter. This
results in less converting between the two types, and fewer sigils.
2026-03-08 22:54:12 +11:00
Zalathar 985b41d387 Remove the rustc_data_structures::assert_matches! re-exports 2026-03-08 22:02:23 +11:00
Zalathar 0a369a799f Replace the try_mark_green hook with direct calls to tcx.dep_graph
All of the existing call sites are directly touching `tcx.dep_graph` anyway, so
the extra layer of indirection provides no real benefit.
2026-03-08 21:53:13 +11:00
Zalathar d7490855d5 Inline and simplify some code for saving incremental data to disk
Main changes:
- Inline `encode_query_cache` and `TyCtxt::serialize_query_result_cache`
- Pull value promotion out of `OnDiskCache::drop_serialized_data`
- Panic if `on_disk_cache` is None in an incremental-only path
2026-03-08 21:27:50 +11:00
bors c7b206bba4 Auto merge of #153383 - nnethercote:overhaul-ensure_ok, r=Zalathar
Overhaul `ensure_ok`

The interaction of `ensure_ok` and the `return_result_from_ensure_ok` query modifier is weird and hacky. This PR cleans it up. Details in the individual commits.

r? @Zalathar
2026-03-08 07:03:35 +00:00
bors c3d014032f Auto merge of #153552 - Zalathar:rollup-MALCpPD, r=Zalathar
Rollup of 4 pull requests

Successful merges:

 - rust-lang/rust#153202 ([win] Fix truncated unwinds for Arm64 Windows)
 - rust-lang/rust#153437 (coretest in miri: fix using unstable libtest features)
 - rust-lang/rust#153446 (Always use the ThinLTO pipeline for pre-link optimizations)
 - rust-lang/rust#153548 (add test for closure precedence in `TokenStream`s)
2026-03-08 03:45:00 +00:00
Stuart Cook 9886a13ab0 Rollup merge of #153548 - cyrgani:closuretest, r=JohnTitor
add test for closure precedence in `TokenStream`s

A test for a regression found by the https://github.com/rust-lang/rust/pull/151830 crater run in several different crates.
2026-03-08 14:01:36 +11:00
Stuart Cook cc0a60fd74 Rollup merge of #153446 - bjorn3:llvm_pre_link_thinlto, r=cuviper
Always use the ThinLTO pipeline for pre-link optimizations

When using cargo this was already effectively done for all dependencies as cargo passes -Clinker-plugin-lto without -Clto=fat/thin. -Clinker-plugin-lto assumes that ThinLTO will be used. The ThinLTO pre-link pipeline is faster than the fat LTO one. And according to the benchmarks in [^1] there is barely any runtime performance difference between executables that used fat LTO with the fat vs ThinLTO pre-link pipeline.

This also helps avoid having yet another code path if we want to support Unified LTO (that is a single bitcode file that supports being used for both fat LTO and ThinLTO when using linker plugin LTO, we already support it when rustc does LTO as ThinLTO bitcode is enough of a superset of fat LTO bitcode that it happens to work by accident if you don't explicitly have a check preventing mixing of them for the current set of LTO features that rustc exposes.) I'm currently still investigating if rustc would benefit from Unified LTO and how exactly to integrate it.

[^1]: https://discourse.llvm.org/t/rfc-a-unified-lto-bitcode-frontend/61774
2026-03-08 14:01:35 +11:00
Stuart Cook a508c476ac Rollup merge of #153437 - RalfJung:miri-libtest-unstable, r=cuviper
coretest in miri: fix using unstable libtest features

Alternative (IMO preferable) to https://github.com/rust-lang/rust/pull/153369. Also reverts that PR.
2026-03-08 14:01:35 +11:00
Stuart Cook 4400f2f835 Rollup merge of #153202 - dpaoliello:arm64unwind, r=cuviper
[win] Fix truncated unwinds for Arm64 Windows

Panic backtraces on ARM64 Windows are truncated because Rust's LLVM configuration sets `NoTrapAfterNoreturn = true`, which suppresses the generation of `brk #0x1` (trap) instructions after calls to `noreturn` functions. Without this trap instruction, the return address from a `noreturn` call points past the end of the calling function into an unrelated function, causing `RtlLookupFunctionEntry` to return the wrong unwind information, which terminates the stack walk prematurely.

In general, `NoTrapAfterNoreturn = true` is recommended against for Windows, since we have seen security vulnerabilities in the past where an attacker has managed to return from a noreturn function, or the function wasn't actually noereturn, resulting in executing whatever was after the call.

This change disables setting `NoTrapAfterNoreturn = true` for Windows.

Fixes rust-lang/rust#140489
2026-03-08 14:01:34 +11:00
A4-Tacks d4e76b7cb8 Merge pull request #21782 from jaroslawroszyk/feat-parse-json
feat: add --json flag to rust-analyzer parse
2026-03-08 02:56:38 +00:00
Jaroslaw Roszyk a1a242a54b feat: add --json flag to rust-analyzer parse 2026-03-08 03:46:24 +01:00
Chayim Refael Friedman 20ef0c6658 Merge pull request #21781 from CodeLoopdroid/feature/clone-subtree
Migrate two assists to clone_subtree to ease SyntaxEditor transition
2026-03-08 01:22:39 +00:00
bors 052b9c23da Auto merge of #153521 - Zalathar:predicates-of, r=nnethercote
Don't use incremental disk-cache for query `predicates_of`

The `predicates_of` query is a relatively modest wrapper around a few underlying queries that are themselves cached to disk. Removing the additional layer of disk caching appears to be a significant perf win.

This query also appears to be the only query that uses a crate-local `cache_on_disk_if` condition, without also using the `separate_provide_extern` modifier.

- Discovered via https://github.com/rust-lang/rust/pull/153487#discussion_r2895304051
2026-03-07 23:31:34 +00:00
Divyesh 9d5b5f8a02 ide-assists: remove unnecessary clones in two assists 2026-03-08 04:16:42 +05:30
Nicholas Nethercote d4503b017e Overhaul ensure_ok.
`ensure_ok` provides a special, more efficient way of calling a query
when its return value isn't needed. But there is a complication: if the
query is marked with the `return_result_from_ensure_ok` modifier, then
it will return `Result<(), ErrorGuaranteed`. This is clunky and feels
tacked on. It's annoying to have to add a modifier to a query to declare
information present in its return type, and it's confusing that queries
called via `ensure_ok` have different return types depending on the
modifier.

This commit:

- Eliminates the `return_result_from_ensure_ok` modifier. The proc macro
  now looks at the return type and detects if it matches `Result<_,
  ErrorGuarantee>`. If so, it adds the modifier
  `returns_error_guaranteed`. (Aside: We need better terminology to
  distinguish modifiers written by the user in a `query` declaration
  (e.g. `cycle_delayed_bug`) from modifiers added by the proc macro
  (e.g. `cycle_error_handling`.))

- Introduces `ensure_result`, which replaces the use of `ensure_ok` for
  queries that return `Result<_, ErrorGuarantee>`. As a result,
  `ensure_ok` can now only be used for the "ignore the return value"
  case.
2026-03-08 09:39:39 +11:00
cyrgani 1ff7ed583f add test for closure precedence in TokenStreams 2026-03-07 21:02:10 +00:00
bors e370b60cf2 Auto merge of #153544 - JonathanBrouwer:rollup-LT1ogBG, r=JonathanBrouwer
Rollup of 2 pull requests

Successful merges:

 - rust-lang/rust#153462 (Bootstrap update)
 - rust-lang/rust#152210 (Gate #![reexport_test_harness_main] properly)
2026-03-07 20:04:00 +00:00
Jonathan Brouwer 0da3785222 Rollup merge of #152210 - Ozzy1423:attrs7, r=JonathanBrouwer
Gate #![reexport_test_harness_main] properly

Address the FIXME

Removed from `issue-43106-gating-of-builtin-attrs.rs` since that is for stable attributes only.

This would be a breaking change, search of github shows it is mostly but not always used with `#![test_runner]` which is already gated correctly.

Details:
https://github.com/rust-lang/rust/issues/50297

Feel free to close this issue if you think it is not worth addressing the FIXME...
2026-03-07 20:02:30 +01:00
Jonathan Brouwer 65a7e52f63 Rollup merge of #153462 - cuviper:bootstrap-update, r=Mark-Simulacrum
Bootstrap update

- Replace version placeholders with 1.95.0
- Bump stage0 to 1.95.0-beta.1
- Clear `STAGE0_MISSING_TARGETS`
- Update `cfg(bootstrap)`
- Reformat with the new stage0
2026-03-07 20:02:29 +01:00
Josh Stone eb093cfd5d Reformat with the new stage0 2026-03-07 10:42:02 -08:00
Josh Stone 32bae1353e Update cfg(bootstrap) 2026-03-07 10:42:02 -08:00
Josh Stone 7e04ef8df5 Clear STAGE0_MISSING_TARGETS 2026-03-07 10:42:02 -08:00
Josh Stone 1bc673f096 Bump stage0 to 1.95.0-beta.1 2026-03-07 10:42:02 -08:00
Josh Stone 78157ddde9 Replace version placeholders with 1.95.0
(cherry picked from commit bad24ccbec)
2026-03-07 10:42:01 -08:00
Daniel Scherzer c0cb69904e .mailmap: fix broken line with multiple emails
Split binarycat's entry into multiple lines, one for each extra email
2026-03-07 10:20:30 -08:00
bors e3d66fe39a Auto merge of #153541 - JonathanBrouwer:rollup-XmqEf4Q, r=JonathanBrouwer
Rollup of 2 pull requests

Successful merges:

 - rust-lang/rust#153494 (Replace Box<[TraitCandidate]> with &'hir [TraitCandidate<'hir>])
 - rust-lang/rust#153465 (Fix incorrect rustdoc JSON representation of `#[doc(test(..))]` attrs.)
2026-03-07 16:38:09 +00:00