Skip to content

Rustc pull update#2067

Open
workflows-stdarch[bot] wants to merge 144 commits intomainfrom
rustc-pull
Open

Rustc pull update#2067
workflows-stdarch[bot] wants to merge 144 commits intomainfrom
rustc-pull

Conversation

@workflows-stdarch
Copy link
Copy Markdown

Latest update from rustc.

The rustc-josh-sync Cronjob Bot and others added 30 commits January 8, 2026 04:21
Configure flycheck using workspace.discoverConfig
Fix not disable string escape highlights
feat: Allow rust paths in symbol search
Fix loses exists guard for move_guard
Fix not applicable on statement for convert_to_guarded_return
Pull recent changes from https://github.com/rust-lang/rust via Josh.

Upstream ref: 94a0cd15f5976fa35e5e6784e621c04e9f958e57
Filtered ref: 1b46aa0fdb1e825363174ce509e40466cc0af416
Upstream diff: rust-lang/rust@004d710...94a0cd1

This merge was created using https://github.com/rust-lang/josh-sync.
fix: Handle `Self::EnumVariant` and `Self` on traits in doclinks
fix: complete inferred type in static
fix: Fix a panic where an opaque was constrained to an impossible type in method autoderef
fix: Fix diagnostics being leaked when diagnostics panic
feat: Implement support for `feature(new_range)`
…fetime

migrate introduce_named_lifetime assist to SyntaxEditor
Fix complete semicolon in array expression
Fix incorrect Self path expand for inline_call
…-impl-to-use-astnodeedit

migrate generate_impl assist to use AstNodeEdit
internal: Refactor handling of associated type shorthand for type parameters, i.e. `T::AssocType` without specifying the trait
fix: Fix predicates of builtin derive traits with two parameters defaulting to `Self`
fix: complete derive helpers on empty nameref
fix: no complete suggest param in complex pattern
fix: complete `.let` on block tail prefix expression
JonathanBrouwer and others added 12 commits March 23, 2026 12:14
…ulacrum

implement `BinaryHeap::as_mut_slice`

Tracking issue: rust-lang/rust#154009
…ooeo

ui/lto: move and rename two tests from issues/

Move:
- `tests/ui/issues/issue-44056.rs` -> `tests/ui/lto/lto-avx-target-feature.rs`
    - The first test enables both AVX target features and LTO but does not exercise AVX-specific behavior. The test primarily checks that LTO builds successfully with these flags; place it under `ui/lto` for consistency.
- `tests/ui/issues/issue-51947.rs` -> `tests/ui/lto/lto-weak-merge-functions.rs`
    - The second test exercises weak linkage interacting with LTO (merge-functions), so it should belong in `ui/lto`.

I have also added a commented line at the top of each test file indicating the issue it originated from.
allow `incomplete_features` in most UI tests

This PR allows the `incomplete_features` lint for all UI tests except for the three directories with the largest number of tests (`traits`, `specialization` and `const-generics`) triggering this lint to keep the size of this PR manageable. The remaining three directories will be handled in followup PRs.

Part of rust-lang/rust#154168.
Add new alias for Guillaume Gomez email address

I'm switching to a new email account and slowly updating all references to the old one.
diagnostics: avoid ICE for undeclared generic parameter in impl

Avoid an ICE for:

    struct A;
    impl A<B> {}

The compiler no longer panics and can proceed to emit existing diagnostics.

Adds `tests/ui/missing/undeclared-generic-parameter.rs`.

Fixes rust-lang/rust#154165 and introduced by rust-lang/rust#152913
…cking_issue, r=JonathanBrouwer

Update the tracking issue for #[diagnostic::on_move]

PR rust-lang/rust#150935 has been merged and then I have opened the tracking issue (whoops ?). So this update `compiler/rustc_feature/src/unstable.rs` to point to the right tracking issue.

This is related to the tracking issue rust-lang/rust#154181
Use enums to clarify `DepNodeColorMap` color marking

When a function's documentation has to explain the meaning of nested results and options, then it is often a good candidate for using a custom result enum instead.

This PR also renames `DepNodeColorMap::try_mark` to `try_set_color`, to make it more distinct from the similarly-named `DepGraph::try_mark_green`.

The difference is that `try_mark_green` is a higher-level operation that tries to determine whether a node _can_ be marked green, whereas `try_set_color` is a lower-level operation that actually records a colour for the node.

The updated docs for `try_set_color` also fix a typo: *atomicaly* → *atomically*.

r? nnethercote (or compiler)
…uwer

Rollup of 21 pull requests

Successful merges:

 - rust-lang/rust#152543 (privacy: Fix type privacy holes in RPITITs)
 - rust-lang/rust#153107 (Optimize BTreeMap::append() using CursorMut)
 - rust-lang/rust#153312 (Packages as namespaces part 1)
 - rust-lang/rust#153534 (Remove a flaky `got_timeout` assert from two channel tests)
 - rust-lang/rust#153718 (Fix environ on FreeBSD with cdylib targets that use -Wl,--no-undefined .)
 - rust-lang/rust#153857 (Rename `target.abi` to `target.cfg_abi` and enum-ify llvm_abiname)
 - rust-lang/rust#153880 (Lifted intersperse and intersperse_with Fused transformation and updated documentation + tests)
 - rust-lang/rust#153931 (remove usages of to-be-deprecated numeric constants)
 - rust-lang/rust#150630 (Unknown -> Unsupported compression algorithm)
 - rust-lang/rust#153491 (Move `freeze_*` methods to `OpenOptionsExt2`)
 - rust-lang/rust#153582 (Simplify find_attr! for HirId usage)
 - rust-lang/rust#153623 (std: move `sys::pal::os` to `sys::paths`)
 - rust-lang/rust#153647 (docs(fs): Clarify That File::lock Coordinates Across Processes)
 - rust-lang/rust#153936 (Skip stack_start_aligned for immediate-abort)
 - rust-lang/rust#154011 (implement `BinaryHeap::as_mut_slice`)
 - rust-lang/rust#154167 (ui/lto: move and rename two tests from issues/)
 - rust-lang/rust#154174 (allow `incomplete_features` in most UI tests)
 - rust-lang/rust#154175 (Add new alias for Guillaume Gomez email address)
 - rust-lang/rust#154182 (diagnostics: avoid ICE for undeclared generic parameter in impl)
 - rust-lang/rust#154188 (Update the tracking issue for #[diagnostic::on_move])
 - rust-lang/rust#154201 (Use enums to clarify `DepNodeColorMap` color marking )
…uwer

Rollup of 13 pull requests

Successful merges:

 - rust-lang/rust#154241 (`rust-analyzer` subtree update)
 - rust-lang/rust#153686 (`std`: include `dlmalloc` for all non-wasi Wasm targets)
 - rust-lang/rust#154105 (bootstrap: Pass `--features=rustc` to rustc_transmute)
 - rust-lang/rust#153069 ([BPF] add target feature allows-misaligned-mem-access)
 - rust-lang/rust#154085 (Parenthesize or-patterns in prefix pattern positions in pretty printer)
 - rust-lang/rust#154191 (refactor RangeFromIter overflow-checks impl)
 - rust-lang/rust#154207 (Refactor query loading)
 - rust-lang/rust#153540 (drop derive helpers during attribute parsing)
 - rust-lang/rust#154140 (Document consteval behavior of ub_checks, overflow_checks, is_val_statically_known.)
 - rust-lang/rust#154161 (On E0277 tweak help when single type impls traits)
 - rust-lang/rust#154218 (interpret/validity: remove unreachable error kind)
 - rust-lang/rust#154225 (diagnostics: avoid ICE in confusable_method_name for associated functions)
 - rust-lang/rust#154228 (Improve inline assembly error messages)
Always check `ConstArgHasType` even when otherwise ignoring



fixes rust-lang/rust#149774

helping @BoxyUwU finish up rust-lang/rust#150322, this is a simple tweak/finishing-up of that PR.

this is a breaking change that crater detected has some issues with in Boxy's PR, and hence needs a t-types FCP. I can go and help fix those crates if/once the break is signed off on.
Link LLVM dynamically on aarch64-apple-darwin



Follow-up to rust-lang/rust#152768.

* Link LLVM dynamically on MacOS
* Fix a macOS LLVM dylib name mismatch
…bank

rustc_expand: improve diagnostics for non-repeatable metavars



There was an initally opened pr which solve this issue here rust-lang/rust#152679. It got merged but, there was a perf regression. And this new pr is opened to address the problem. The first did the computation of binding and matched_rule and then passed them as owned value down to `diagnostics::emit_frag_parse_err(` but, now this pr address the issue by passing `lhs` and `rules` as borrowed value to from_tts and the move the logic to `diagnostics::emit_frag_parse_err(`.

Fix rust-lang/rust#47452.
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Mar 26, 2026

r? @folkertdev

rustbot has assigned @folkertdev.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: @Amanieu, @folkertdev, @sayantn
  • @Amanieu, @folkertdev, @sayantn expanded to Amanieu, folkertdev, sayantn
  • Random selection from Amanieu, folkertdev, sayantn

bors and others added 14 commits March 26, 2026 05:30
Suggest using equality comparison instead of pattern matching on non-structural constant in pattern

When encountering a pattern containing a non-structural constant (not marked as `#[derive(PartialEq)]` to make it suitable for pattern matching, `C` in the examples below), we would previously not provide additional guidance. With this PR, the `help` in the following examples are added:

```
error: constant of non-structural type `partial_eq::S` in a pattern
  --> $DIR/suggest_equality_comparison_instead_of_pattern_matching.rs:16:18
   |
LL |     struct S;
   |     -------- `partial_eq::S` must be annotated with `#[derive(PartialEq)]` to be usable in patterns
...
LL |     const C: S = S;
   |     ---------- constant defined here
...
LL |             Some(C) => {}
   |                  ^ constant of non-structural type
   |
note: the `PartialEq` trait must be derived, manual `impl`s are not sufficient; see https://doc.rust-lang.org/stable/std/marker/trait.StructuralPartialEq.html for details
  --> $DIR/suggest_equality_comparison_instead_of_pattern_matching.rs:5:5
   |
LL |     impl PartialEq<S> for S {
   |     ^^^^^^^^^^^^^^^^^^^^^^^
help: add a condition to the match arm checking for equality
   |
LL -             Some(C) => {}
LL +             Some(binding) if binding == C => {}
   |
```

```
error: constant of non-structural type `partial_eq::S` in a pattern
  --> $DIR/suggest_equality_comparison_instead_of_pattern_matching.rs:22:18
   |
LL |     struct S;
   |     -------- `partial_eq::S` must be annotated with `#[derive(PartialEq)]` to be usable in patterns
...
LL |     const C: S = S;
   |     ---------- constant defined here
...
LL |         let Some(C) = Some(S) else { return; };
   |                  ^ constant of non-structural type
   |
note: the `PartialEq` trait must be derived, manual `impl`s are not sufficient; see https://doc.rust-lang.org/stable/std/marker/trait.StructuralPartialEq.html for details
  --> $DIR/suggest_equality_comparison_instead_of_pattern_matching.rs:5:5
   |
LL |     impl PartialEq<S> for S {
   |     ^^^^^^^^^^^^^^^^^^^^^^^
help: check for equality instead of pattern matching
   |
LL -         let Some(C) = Some(S) else { return; };
LL +         if Some(C) == Some(S) { return; };
   |
```

The suggestion accounts for a few conditions:

 - if the type is not from the local crate and has no `PartialEq` impl, the user can't make it structural, so we don't provide the suggestion
 - regardless of whether the type is local or remote, if it has a manual `PartialEq`, explain that with a derived `PartialEq` you could use equality
 - if the type is local and has no impl, suggest adding a derived `PartialEq` and use equality check instead of pattern matching
 - when suggesting equality, account for `if-let` to suggest chaining (edition dependent), `match` arm with a present `if` check, `match` arm without an existing `if` check
 - when encountering `let-else`, we suggest turning it into an `if` expression instead (this doesn't check for additional bindings beyond the constant, which would suggest incorrect code in some more complex cases).

Fix rust-lang/rust#42753.
constify `Step` trait and all of its `impl`ementations

constifying [Step](rust-lang/rust#42168) trait and all of its implementations, with some friendly help from [const_cmp](rust-lang/rust#143800)
…RalfJung

Merge `fabsf16/32/64/128` into `fabs::<F>`

Following [a small conversation on Zulip](https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/Float.20intrinsics/with/521501401) (and because I'd be interested in starting to contribute on Rust), I thought I'd give a try at merging the float intrinsics :)

This PR just merges `fabsf16`, `fabsf32`, `fabsf64`, `fabsf128`, as it felt like an easy first target.

Notes:
- I'm opening the PR for one intrinsic as it's probably easier if the shift is done one intrinsic at a time, but let me know if you'd rather I do several at a time to reduce the number of PRs.
- Currently this PR increases LOCs, despite being an attempt at simplifying the intrinsics/compilers. I believe this increase is a one time thing as I had to define new functions and move some things around, and hopefully future PRs/commits will reduce overall LoCs
- `fabsf32` and `fabsf64` are `#[rustc_intrinsic_const_stable_indirect]`, while `fabsf16` and `fabsf128` aren't; because `f32`/`f64` expect the function to be const, the generic version must be made indirectly stable too. We'd need to check with T-lang this change is ok; the only other intrinsics where there is such a mismatch is `minnum`, `maxnum` and `copysign`.
- I haven't touched libm because I'm not familiar with how it works; any guidance would be welcome!
…ski,antoyo

simd_fmin/fmax: make semantics and name consistent with scalar intrinsics

This is the SIMD version of rust-lang/rust#153343: change the documented semantics of the SIMD float min/max intrinsics to that of the scalar intrinsics, and also make the name consistent. The overall semantic change this amounts to is that we restrict the non-determinism: the old semantics effectively mean "when one input is an SNaN, the result non-deterministically is a NaN or the other input"; the new semantics say that in this case the other input must be returned. For all other cases, old and new semantics are equivalent. This means all users of these intrinsics that were correct with the old semantics are still correct: the overall set of possible behaviors has become smaller, no new possible behaviors are being added.

In terms of providers of this API:
- Miri, GCC, and cranelift already implement the new semantics, so no changes are needed.
- LLVM is adjusted to use `minimumnum nsz` instead of `minnum`, thus giving us the new semantics.

In terms of consumers of this API:
- Portable SIMD almost certainly wants to match the scalar behavior, so this is strictly a bugfix here.
- Stdarch mostly stopped using the intrinsic, except on nvptx, where arguably the new semantics are closer to what we actually want than the old semantics (#2056).

Q: Should there be an `f` in the intrinsic name to indicate that it is for floats? E.g., `simd_fminimum_number_nsz`?

Also see rust-lang/rust#153395.
…acrum

triagebot: add reminder for bumping CI LLVM stamp

I'm not sure what else can be done automatically to help us not forget this, but at least this gives a chance for the PR author/reviewer to be reminded (e.g. myself).
…t-dist-x86_64, r=marcoieni

Fix LegacyKeyValueFormat report from docker build: dist-x86_64

Part of rust-lang/rust#152305

r? @marcoieni
…-Simulacrum

`trim_prefix` for paths

under rust-lang/rust#142312?

its a useful method.
Fix ice in rustdoc of private reexport

Fixes rust-lang/rust#154383

The root cause is rustdoc could still try to resolve links for source docs that resolver did not cache in `ResolveDocLinks::Exported` mode. The test case will not crash with `--document-private-items` option, which will use `ResolveDocLinks::All`.

The fix makes rustdoc skip link resolution based on the source `DefId` of each doc fragment, so its behavior stays aligned with resolver's logic here: https://github.com/chenyukang/rust/blob/dc5cb1719eed6ac9275fe93d914d32141606b2ac/compiler/rustc_resolve/src/late.rs#L685
move many tests from `structs-enums` to `structs` or `enum`

This PR moves most of the tests in `ui/structs-enums` that are only about structs or only about enums to their respective directory, as a step towards removing `ui/structs-enums`.
Followup to rust-lang/rust#154131.
r? @Kivooeo
Notify stdarch maintainers on changes in std_detect

cc @Amanieu @folkertdev @Kobzol

It would be nice to be notified when std_detect changes, as it is spiritually a part of stdarch.

Also assign @rust-lang/libs to std_detect
Rollup of 9 pull requests

Successful merges:

 - rust-lang/rust#153380 (stabilize new RangeFrom type and iterator)
 - rust-lang/rust#153834 (Merge `fabsf16/32/64/128` into `fabs::<F>`)
 - rust-lang/rust#154043 (simd_fmin/fmax: make semantics and name consistent with scalar intrinsics)
 - rust-lang/rust#154494 (triagebot: add reminder for bumping CI LLVM stamp)
 - rust-lang/rust#153374 (Fix LegacyKeyValueFormat report from docker build: dist-x86_64)
 - rust-lang/rust#154320 (`trim_prefix` for paths)
 - rust-lang/rust#154453 (Fix ice in rustdoc of private reexport)
 - rust-lang/rust#154504 (move many tests from `structs-enums` to `structs` or `enum`)
 - rust-lang/rust#154515 (Notify stdarch maintainers on changes in std_detect)
Make typeck a tcx method which calls typeck_root query



Currently typeck query itself calls `tcx.typeck(tcx.typeck_root_def_id(key))` if its key isn't a type-check root. I thought this might be an overhead and made typeck a tcx method which calls typeck_root query instead.

This is a step to simplify `cache_on_disk_if` query modifier.

@petrochenkov please run perf
This updates the rust-version file to 80ad55752e5ae6c2d1bc143b819eb8d1c00167d1.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.