Skip to content

Rustc pull update#2834

Merged
tshepang merged 64 commits intomainfrom
rustc-pull
Apr 13, 2026
Merged

Rustc pull update#2834
tshepang merged 64 commits intomainfrom
rustc-pull

Conversation

@workflows-rustc-dev-guide
Copy link
Copy Markdown

Latest update from rustc.

ChayimFriedman2 and others added 30 commits March 20, 2026 06:28
…o-such-field

Fix not applicable on empty struct for no_such_field
Add applicable on LetExpr for unwrap_tuple
Add wrap multiple attr for wrap_unwrap_cfg_attr
Add nested lifetime support for add_lifetime_to_type
Add fixes for non_exhaustive_let diagnostic
Support WhileExpr and ForExpr for add_label_to_loop
Fix postfix completion indentation compensation
feat: change test_name placeholder to executable_arg
Add applicable on let-else branch for unwrap_block
…expr

Fix asm sym operand parsing for parenthesized expr fragments
…rom-new-to-syntax-editor

internal: Migrate `generate_default_from_new` assist to `SyntaxEditor`
fix: wrap ty-anchor in non-path type constuctor
…isplay

fix: Correct Display label for Event::FetchWorkspaces
…ors/code/multi-bf05dc1ecf

Bump picomatch in /editors/code
…essages

fix: Correct missing-args messages for sched_getaffinity and getenv shims
…t-fn-body

Replace make constructor with syntaxFactory in utils/gen trait fn body
fix: Improve inserted order for trait_impl_redundant_assoc_item
impl Display type hint inlay hints at the end of the line #4318
feat: add support for folding ranges for chained expressions
Publish no-server to Code Marketplace and OpenVSX
…ys-proc

make matching brace work when cursor not at bracket
JonathanBrouwer and others added 26 commits April 13, 2026 14:02
`rust-analyzer` subtree update

Subtree update of `rust-analyzer` to rust-lang/rust-analyzer@7b6e124.

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

r? @ghost
Add #![unstable_removed(..)] attribute to track removed features

Adds the #![unstable_removed(..)] attribute to enable tracking removed library features.
Produce an error when a removed attribute is used.
Add a test that it works.

For rust-lang/rust#141617

r? @jyn514
…ackh726

Handle RTN projections in assoc type restriction diagnostics

Fixes rust-lang/rust#152887
…pl-traits, r=petrochenkov

delegation: support proper interaction of user-specified args and impl Traits

This PR supports usages of user-specified args with impl Traits. When there are user-specified args in child we still need to generate synthetic generic params and use them during signature inheritance:
```rust
fn foo<T, const N: usize>(f: impl FnOnce()) {}

reuse foo::<String, 123> as bar;

//desugaring
fn bar<TSynth: impl FnOnce()>(f: _) {
    foo::<String, 123>(f)
}
```
When inheriting predicates we process impl Trait ones, so we need generic params to instantiate them. Other approach may involve not generating synthetic generic params and try to filter out those predicates, but fairly generating synthetic params seems more consistent?.

Fixes rust-lang/rust#154780, part of rust-lang/rust#118212.

r? @petrochenkov
…ics, r=Amanieu

cg_llvm: scalable vectors with `simd_cast` and `simd_select`

Previously `sve_cast`'s implementation was abstracted to power both `sve_cast` and `simd_cast` which supported scalable and non-scalable vectors respectively. In anticipation of having to do this for another `simd_*` intrinsic, `sve_cast` is removed and `simd_cast` is changed to accept both scalable and non-scalable intrinsics, an approach that will scale better to the other intrinsics.

Building on the previous change, support scalable vectors with `simd_select`. Previous patches already landed the necessary changes in the implementation of this intrinsic, but didn't allow scalable vector arguments to be passed in.
…zelmann,kivooeo

add regression test for OpenOptionsExt downstream compat

Following up on rust-lang/rust#153491, which added a warning comment there, but no automated guardrail to prevent another breaking change like rust-lang/rust#149718

This adds a simple windows-only ui test that manually implements `OpenOptionsExt`. That way, if someone accidentally adds another required method to the trait, we catch it before it reaches stable and breaks downstream crates like Tokio again.

Closes rust-lang/rust#153486
Make the expansion of guard metavars begin guard non-terminals

While investigating something unrelated, I noticed a bug in the impl of unstable feature `macro_guard_matcher` (tracking issue: rust-lang/rust#153104). Namely, the following doesn't compile:

```rs
#![feature(macro_guard_matcher)]

macro_rules! a { ($guard:guard) => { b!($guard); }; }
macro_rules! b { ($guard:guard) => {}; }
a!(if true);
```

```
error: no rules expected `guard` metavariable
 --> src/lib.rs:3:41
  |
3 | macro_rules! a { ($guard:guard) => { b!($guard); }; }
  |                                         ^^^^^^ no rules expected this token in macro call
4 | macro_rules! b { ($guard:guard) => {}; }
  | -------------- when calling this macro
5 | a!(if true);
  | ----------- in this macro invocation
  |
note: while trying to match meta-variable `$guard:guard`
 --> src/lib.rs:4:19
  |
4 | macro_rules! b { ($guard:guard) => {}; }
  |                   ^^^^^^^^^^^^
  = note: this error originates in the macro `a` (in Nightly builds, run with -Z macro-backtrace for more info)
```

---

While I'm still skeptical of `guard` fragment specifiers in general (although I can't quite pinpoint why), I figured I should fix this issue.
…, r=petrochenkov

delegation: revert execution of hir_crate_items before delayed lowering

This PR reverts rust-lang/rust#154368, as after weekend consideration I don't think that it is a correct way of fixing cycles during delayed lowering:

- The number of ICEs were reported, fixing them would require to develop solution from rust-lang/rust#154368 but I am afraid that it would lead to cancer code growing,
- The [memory regression](rust-lang/rust#154368 (comment)) for rustdoc was reported, it can be fixed with moving `tcx.force_delayed_owners_lowering` call earlier, but it is already bad that this is call is now required everywhere, before rust-lang/rust#154368 AST was dropped before `hir_crate_items` automatically and users of `rustc` API did not have to think about it.

I will try to come up with a more robust solution leaving rust-lang/rust#154368 as a last resort if nothing else will work.

Re-opens rust-lang/rust#154169.
Fixes rust-lang/rust#155125. Fixes rust-lang/rust#155127. Fixes rust-lang/rust#155128. Fixes rust-lang/rust#155164. Fixes rust-lang/rust#155202.
Part of rust-lang/rust#118212.

r? @petrochenkov
…nkov

Use closures more consistently in `dep_graph.rs`.

This file has several methods that take a `FnOnce() -> R` closure:
- `DepGraph::with_ignore`
- `DepGraph::with_query_deserialization`
- `DepGraph::with_anon_task`
- `DepGraphData::with_anon_task_inner`

It also has two methods that take a faux closure via an `A` argument and a `fn(TyCtxt<'tcx>, A) -> R` argument:
- DepGraph::with_task
- DepGraphData::with_task

The rationale is that the faux closure exercises tight control over what state they have access to. This seems silly when (a) they are passed a `TyCtxt`, and (b) when similar nearby functions take real closures. And they are more awkward to use, e.g. requiring multiple arguments to be gathered into a tuple. This commit changes the faux closures to real closures.

r? @Zalathar
update thin-vec

With thin-vec v0.2.15 released, copy-pasted implementation of ExtractIf can be removed.
…uwer

Rollup of 10 pull requests

Successful merges:

 - rust-lang/rust#155227 (`rust-analyzer` subtree update)
 - rust-lang/rust#153335 (Add #![unstable_removed(..)] attribute to track removed features)
 - rust-lang/rust#154932 (Handle RTN projections in assoc type restriction diagnostics)
 - rust-lang/rust#155096 (delegation: support proper interaction of user-specified args and impl Traits)
 - rust-lang/rust#155106 (cg_llvm: scalable vectors with `simd_cast` and `simd_select`)
 - rust-lang/rust#155140 (add regression test for OpenOptionsExt downstream compat)
 - rust-lang/rust#155182 (Make the expansion of guard metavars begin guard non-terminals)
 - rust-lang/rust#155226 (delegation: revert execution of hir_crate_items before delayed lowering)
 - rust-lang/rust#153997 (Use closures more consistently in `dep_graph.rs`.)
 - rust-lang/rust#155003 (update thin-vec)
resolve: Some import resolution cleanups

See the individual commits
tests/debuginfo/basic-stepping.rs: Explain why all lines are not steppable

Some optimization passes [_improve_](rust-lang/compiler-team#319) compile times. So we want to run some passes even with `-Copt-level=0`. That means that some debuggable lines can be optimized away. Document that as expected behavior.

Closes rust-lang/rust#33013.

Replaces rust-lang/rust#151426. See that PR for some discussion.
Add --verbose-run-make-subprocess-output flag to suppress verbose run-make output for passing tests

- Adds `--verbose-run-make-subprocess-output` flag to `./x test` and compiletest
- `./x test --no-capture --verbose-run-make-subprocess-output=false` suppresses verbose subprocess output for passing run-make tests
- Failed tests always print their output regardless of `--verbose-run-make-subprocess-output`
- Default behavior (verbose) is unchanged

This addresses the request from @bjorn3  which needs `--no-capture` (due to `panic=abort`) but doesn't want output dumped for every passing test.

Helps with rust-lang/rust#154069

## Test plan

- [x] `./x test tests/run-make/bare-outfile --no-capture --force-rerun` — verbose output for passing test
- [x] `./x test tests/run-make/bare-outfile --no-capture --verbose-run-make-subprocess-output=false --force-rerun` — no verbose output for passing test
- [x] Failing test still dumps output with `--verbose-run-make-subprocess-output=false`
Make `DerefPure` dyn-incompatible

Fixes rust-lang/rust#154619.

If `DerefPure` were dyn-compatible, a trait object of a subtrait of `DerefPure` could be created by unsize-coercing an existing type that implements `DerefPure`. But then the trait object could have its own non-pure impl of `Deref`/`DerefMut`, which is unsound, since the trait object would implement `DerefPure`. Thus, we make `DerefPure` dyn-incompatible.

r? types
Add `const Default` impls for `LazyCell` and `LazyLock`

Follow up to these commits by @estebank rust-lang/rust#134628 and rust-lang/rust#151190.
Tracking issue rust-lang/rust#143894.

cc @fmease @fee1-dead @oli-obk

This enables `static L: LazyLock<D> = Default::default()`  for any type `D: Default` which is safe as `D::default()` is only evaluated at runtime.
…=jackh726

Small refactor of `arena_cache` query values

Query modifier `arena_cache` automatically allocates only `Some` variant of query's value of type `Option<&'tcx T>`, so `mir_callgraph_cyclic` should've been doing it from the beginning. The same could be said for any `Result<&'tcx T, ErrorGuaranteed>` as `ErrorGuaranteed` is a zero sized type, but that requires adding a new `ArenaCached` implementation.
UI automation

# To move issue-3154 and issue-16774 to functional subdirectories:

I have moved 2 tests from tests/ui/issues to their appropriate directories using "test-manager" tool.
## Changes:

- Moved tests/ui/issues/issue-3154.rs to tests/ui/borrowck/missing-lifetime-in-return.rs

- Moved tests/ui/issues/issue-16774.rs to tests/ui/deref/derefmut-closure-drop-order.rs
These moves where performed using the test-manager automation tool.
Move tests from `tests/ui/issues/` to appropriate directories

In this PR, I am moving the following test from `tests/ui/issues` directory to the appropriate directories, followed by the addition of issue links at the top and reblessing of the stderr files:

| old-name | new-sub-dir | new-name |
|-|-|-|
| `issue-29516.rs` | `auto-traits/` | `distinct-type-tuple-by-negative-impl.rs` |
| `issue-3874.rs` | `binding/` | `ref-in-let-lhs-in-field.rs` |
| `issue-32782.rs` | `feature-gates/` | `feature-gate-check-nested-macro-invocation.rs` |
| `issue-32782.stderr` | `feature-gates/` | `feature-gate-check-nested-macro-invocation.stderr` |
| `issue-5100.rs` | `pattern/` | `match-errors-derived-error-suppression.rs` |
| `issue-5100.stderr` | `pattern/` | `match-errors-derived-error-suppression.stderr` |
| `issue-21033.rs` | `pattern/` | `match-struct-var-having-boxed-field.rs` |

r? Kivooeo
r? Teapot4195
…ratt

Stabilize feature `uint_bit_width`

Tracking issue: rust-lang/rust#142326
FCP is finished in rust-lang/rust#142326 (comment)

Closes rust-lang/rust#142326

@rustbot modify labels: +T-libs-api
…e, r=jhpratt

Stabilize feature `int_lowest_highest_one`

Tracking issue: rust-lang/rust#145203
FCP is finished in rust-lang/rust#145203 (comment)

Closes rust-lang/rust#145203

@rustbot modify labels: +T-libs-api
Improve emission of `UnknownDiagnosticAttribute` lint

This checks features much less than the current implementation. See rust-lang/rust#155155 for context. Minor fixes and comments are added in the second and third commit.
Fix manpage version replacement and use verbose version

- Fix a bug where `t!(fs::copy(&page_src, &page_dst))` was called after`fs::write`, silently overwriting the substituted content with the original template (restoring the `<INSERT VERSION HERE>` placeholder verbatim) (Related rust-lang/rust#93685)
- Use `rust_info().version()` instead of the bare version number, so the man page now includes the full version string with commit hash and date
…uwer

Rollup of 19 pull requests

Successful merges:

 - rust-lang/rust#155162 (relnotes for 1.95)
 - rust-lang/rust#140763 (Change codegen of LLVM intrinsics to be name-based, and add llvm linkage support for `bf16(xN)` and `i1xN`)
 - rust-lang/rust#153604 (Fix thread::available_parallelism on WASI targets with threads)
 - rust-lang/rust#154193 (Implement EII for statics)
 - rust-lang/rust#154389 (Add more robust handling of nested query cycles)
 - rust-lang/rust#154435 (resolve: Some import resolution cleanups)
 - rust-lang/rust#155236 (Normalize individual predicate of `InstantiatedPredicates` inside `predicates_for_generics`)
 - rust-lang/rust#155243 (cg_ssa: transmute between scalable vectors)
 - rust-lang/rust#153941 (tests/debuginfo/basic-stepping.rs: Explain why all lines are not steppable)
 - rust-lang/rust#154587 (Add --verbose-run-make-subprocess-output flag to suppress verbose run-make output for passing tests)
 - rust-lang/rust#154624 (Make `DerefPure` dyn-incompatible)
 - rust-lang/rust#154929 (Add `const Default` impls for `LazyCell` and `LazyLock`)
 - rust-lang/rust#154944 (Small refactor of `arena_cache` query values)
 - rust-lang/rust#155055 (UI automation)
 - rust-lang/rust#155062 (Move tests from `tests/ui/issues/` to appropriate directories)
 - rust-lang/rust#155131 (Stabilize feature `uint_bit_width`)
 - rust-lang/rust#155147 (Stabilize feature `int_lowest_highest_one`)
 - rust-lang/rust#155174 (Improve emission of `UnknownDiagnosticAttribute` lint)
 - rust-lang/rust#155194 (Fix manpage version replacement and use verbose version)
This updates the rust-version file to 17584a181979f04f2aaad867332c22db1caa511a.
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 13, 2026

Thanks for the PR. If you have write access, feel free to merge this PR if it does not need reviews. You can request a review using r? rustc-dev-guide or r? <username>.

@rustbot rustbot added the S-waiting-on-review Status: this PR is waiting for a reviewer to verify its content label Apr 13, 2026
@tshepang tshepang merged commit ed46021 into main Apr 13, 2026
1 check passed
@rustbot rustbot removed the S-waiting-on-review Status: this PR is waiting for a reviewer to verify its content label Apr 13, 2026
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.