Skip to content

Rollup of 5 pull requests#155611

Merged
rust-bors[bot] merged 17 commits intorust-lang:mainfrom
JonathanBrouwer:rollup-hUV99y1
Apr 22, 2026
Merged

Rollup of 5 pull requests#155611
rust-bors[bot] merged 17 commits intorust-lang:mainfrom
JonathanBrouwer:rollup-hUV99y1

Conversation

@JonathanBrouwer
Copy link
Copy Markdown
Contributor

Successful merges:

r? @ghost

Create a similar rollup

nnethercote and others added 17 commits April 20, 2026 10:13
The `Flags` trait has two methods: `flags` and `outer_exclusive_binder`.
Multiple types impl this trait and then also have duplicate inherent
methods with the same names; these are all marked with "Think about
removing this" comments. This is left over from things being moved into
`rustc_type_ir`.

This commit removes those inherent methods. This requires adding `use
Flags` to a number of files.
When a function returns `impl Trait`, all branches must return the same
concrete type. Previously, the compiler showed:

    expected `First` because of return type

This was misleading, as it suggested the return type was `First`, rather
than any single type implementing the trait.

Update the diagnostic to:

    expected a single type implementing `Value` because of return type

Also highlight the first return expression to make it clearer why
subsequent returns do not match.

Signed-off-by: Usman Akinyemi <usmanakinyemi202@gmail.com>
…ebank

Improve E0308 error message for `impl Trait` return mismatches

When a function returns `impl Trait`, all branches must return the same concrete type. Previously, the compiler showed:

    expected `First` because of return type

This was misleading, as it suggested the return type was `First`, rather than any single type implementing the trait.

Update the diagnostic to:

    expected a single type implementing `Value` because of return type

Also highlight the first return expression to make it clearer why subsequent returns do not match.
Fix incorrect `let` to `const` suggestion for pattern bindings

When a variable from a pattern binding was referenced inside a `const {}` block, the compiler incorrectly suggested replacing `let` with `const`. This was reported in rust-lang#152831 for `if let`, but also applies to `while let` and `let ... else`.
…r=nikomatsakis

Remove duplicated `Flags` methods.

The `Flags` trait has two methods: `flags` and `outer_exclusive_binder`. Multiple types impl this trait and then also have duplicate inherent methods with the same names; these are all marked with "Think about removing this" comments. This is left over from things being moved into `rustc_type_ir`.

This commit removes those inherent methods. This requires adding `use Flags` to a number of files.

r? @lcnr
…=oli-obk

Use per-parent disambiguators everywhere

This PR addressing the following concerns about per-parent disambiguators (rust-lang#153955):

- DisambiguatorState is removed, PerParentDisambiguatorState is now used everywhere,
- Steals were removed from every per-parent disambiguator in resolver,
- It adds `parent` field in `PerParentDisambiguatorState` in `#[cfg(debug_assertions)]` for asserting that per-parent disambiguator corresponds to the same `LocalDefId` which is passed into `create_def`,
- ~Removes `Disambiguator` trait replacing it with `Disambiguator` enum, with this change we no longer expose `next` method (as trait should be public otherwise the warning will be emitted). It may affect perf in a negative way though.~

~Those changes should not fix perf issues that were [reported](rust-lang#153955 (comment)), perf run that was attempted [before](rust-lang#153955 (comment)) showed much better results. Performance can be probably fixed by removing per-parent disambiguators replacing them with a single one as it was before, then it will be passed to AST -> HIR lowering and modified. For delayed owners we can store ~followup disambiguators as it was in the beginning of the rust-lang#153955~ per-parent disambiguators. This solution should save achievements from rust-lang#153955 (removed `DefPathData` variants).
However, I would prefer to keep per-parent disambiguators as it seems a better architectural solution for me.~

r? @petrochenkov
cc @oli-obk
…d, r=JonathanBrouwer

Remove AttributeLintKind variants - part 5

Part of rust-lang#153099.

r? @JonathanBrouwer
@rust-bors rust-bors Bot added the rollup A PR which is a rollup label Apr 21, 2026
@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) A-meta Area: Issues & PRs about the rust-lang/rust repository itself S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) labels Apr 21, 2026
@JonathanBrouwer
Copy link
Copy Markdown
Contributor Author

@bors r+ rollup=never p=5

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Apr 21, 2026

📌 Commit 79e2ff7 has been approved by JonathanBrouwer

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 21, 2026
@rust-bors

This comment has been minimized.

@rust-bors rust-bors Bot added merged-by-bors This PR was explicitly merged by bors. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Apr 22, 2026
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Apr 22, 2026

☀️ Test successful - CI
Approved by: JonathanBrouwer
Duration: 3h 22m 15s
Pushing f9988fe to main...

@rust-bors rust-bors Bot merged commit f9988fe into rust-lang:main Apr 22, 2026
12 checks passed
@rustbot rustbot added this to the 1.97.0 milestone Apr 22, 2026
@rust-timer
Copy link
Copy Markdown
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#152834 Fix incorrect let to const suggestion for pattern bindi… 1fb0491c4fc5bd7691750b58fcf4a3ad87624339 (link)
#155425 Remove duplicated Flags methods. 3c5e7aaddbef8c84ec10d4b0ccc62b740dcc6ad9 (link)
#155546 Improve E0308 error message for impl Trait return mismatc… d5e6622e4a64fc0abc61eed355a9c6e35de38b02 (link)
#155547 Use per-parent disambiguators everywhere 64e60df1d6538c86802b895acccf8afa852ba29b (link)
#155590 Remove AttributeLintKind variants - part 5 d9317ef68569b1e43b1ebb365037bd1c72032367 (link)

previous master: 9ec5d5f32e

In the case of a perf regression, run the following command for each PR you suspect might be the cause: @rust-timer build $SHA

@github-actions
Copy link
Copy Markdown
Contributor

What is this? This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.

Comparing 9ec5d5f (parent) -> f9988fe (this PR)

Test differences

Show 60 test diffs

Stage 1

  • [ui] tests/ui/consts/non-const-value-in-const-irrefutable-pat-binding.rs: [missing] -> pass (J1)
  • [ui] tests/ui/consts/non-const-value-in-const-pat-binding.rs: [missing] -> pass (J1)

Stage 2

  • [ui] tests/ui/consts/non-const-value-in-const-irrefutable-pat-binding.rs: [missing] -> pass (J0)
  • [ui] tests/ui/consts/non-const-value-in-const-pat-binding.rs: [missing] -> pass (J0)

Additionally, 56 doctest diffs were found. These are ignored, as they are noisy.

Job group index

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard f9988fefd3add01f414f52b414308e7872622fee --output-dir test-dashboard

And then open test-dashboard/index.html in your browser to see an overview of all executed tests.

Job duration changes

  1. x86_64-gnu-llvm-22-1: 53m 22s -> 1h 16m (+42.5%)
  2. i686-msvc-1: 2h 18m -> 3h 10m (+37.8%)
  3. dist-ohos-x86_64: 1h 2m -> 1h 20m (+29.9%)
  4. dist-powerpc64le-linux-gnu: 1h 17m -> 1h 36m (+25.1%)
  5. x86_64-rust-for-linux: 43m 35s -> 53m 27s (+22.6%)
  6. aarch64-gnu-llvm-21-1: 53m 38s -> 1h 4m (+20.4%)
  7. dist-armv7-linux: 1h 30m -> 1h 11m (-20.4%)
  8. pr-check-1: 26m 33s -> 31m 33s (+18.8%)
  9. dist-powerpc64-linux-gnu: 1h 16m -> 1h 30m (+18.0%)
  10. dist-x86_64-llvm-mingw: 1h 47m -> 1h 29m (-17.3%)
How to interpret the job duration changes?

Job durations can vary a lot, based on the actual runner instance
that executed the job, system noise, invalidated caches, etc. The table above is provided
mostly for t-infra members, for simpler debugging of potential CI slow-downs.

@rust-timer
Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (f9988fe): comparison URL.

Overall result: ✅ improvements - no action needed

@rustbot label: -perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.0% [-0.0%, -0.0%] 1
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (primary 1.5%, secondary 1.3%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
1.5% [1.5%, 1.5%] 1
Regressions ❌
(secondary)
1.3% [1.1%, 1.5%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 1.5% [1.5%, 1.5%] 1

Cycles

Results (primary -2.1%, secondary -0.4%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
3.6% [3.6%, 3.6%] 1
Improvements ✅
(primary)
-2.1% [-2.1%, -2.1%] 1
Improvements ✅
(secondary)
-4.4% [-4.4%, -4.4%] 1
All ❌✅ (primary) -2.1% [-2.1%, -2.1%] 1

Binary size

This perf run didn't have relevant results for this metric.

Bootstrap: 489.594s -> 490.294s (0.14%)
Artifact size: 394.45 MiB -> 394.43 MiB (-0.00%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) A-meta Area: Issues & PRs about the rust-lang/rust repository itself merged-by-bors This PR was explicitly merged by bors. rollup A PR which is a rollup T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants