Skip to content

Rollup of 6 pull requests#155596

Merged
rust-bors[bot] merged 18 commits intorust-lang:mainfrom
jhpratt:rollup-zyXU16X
Apr 21, 2026
Merged

Rollup of 6 pull requests#155596
rust-bors[bot] merged 18 commits intorust-lang:mainfrom
jhpratt:rollup-zyXU16X

Conversation

@jhpratt
Copy link
Copy Markdown
Member

@jhpratt jhpratt commented Apr 21, 2026

Successful merges:

r? @ghost

Create a similar rollup

mu001999 and others added 18 commits April 9, 2026 23:53
Replace the hacky macro with a generic function and a new
`FlatMapInPlaceVec` trait. More verbose but more readable and typical.

LLM disclosure: I asked Claude Code to critique this file and it
suggested the generic function + trait idea. I implemented the idea
entirely by hand.
* tests: add whitespace tests for vertical tab behavior

Add two small tests to highlight how vertical tab is handled differently.

- vertical_tab_lexer.rs checks that the lexer treats vertical tab as whitespace
- ascii_whitespace_excludes_vertical_tab.rs shows that split_ascii_whitespace does not split on it

This helps document the difference between the Rust parser (which accepts vertical tab)
and the standard library’s ASCII whitespace handling.

See: rust-lang/rust-project-goals#53
* tests: add ignore-tidy-tab directive to whitespace tests
* tests: expand vertical tab lexer test to cover all Pattern_White_Space chars
* tests: add whitespace/ README entry explaining lexer vs stdlib mismatch
* Update ascii_whitespace_excludes_vertical_tab.rs
* Update ascii_whitespace_excludes_vertical_tab.rs

make sure tabs and spaces are well checked
* Update ascii_whitespace_excludes_vertical_tab.rs
* fix tidy: add whitespace README entry
* Update README.md with missing full stop
* Update ascii_whitespace_excludes_vertical_tab.rs
* fix tidy: use full path format for whitespace README entry
* fix tidy: README order, trailing newlines in whitespace tests
* fix: add run-pass directive and restore embedded whitespace bytes
* fix tidy: remove duplicate whitespace README entry
* 

Add failing UI test for invalid whitespace (zero width space)

This adds a //@ check-fail test to ensure that disallowed whitespace
characters like ZERO WIDTH SPACE are rejected by the Rust lexer.
* git add tests/ui/whitespace/invalid_whitespace.rs
git commit -m "Fix tidy: add trailing newline"
git push
* Fix tidy: add trailing newline
* Update invalid_whitespace.rs
* Update invalid_whitespace.rs
* Clean up whitespace in invalid_whitespace.rs

Remove unnecessary blank lines in invalid_whitespace.rs
* Update invalid_whitespace.rs
* Clarify ZERO WIDTH SPACE usage in test

Update comment to clarify usage of ZERO WIDTH SPACE.
* Improve error messages for invalid whitespace

Updated error messages to clarify the issue with invisible characters.
* Modify invalid_whitespace test for clarity

Update test to check for invalid whitespace characters.
* Resolve unknown token error in invalid_whitespace.rs

Fix whitespace issue causing unknown token error.
* Remove invisible character from variable assignment

Fix invisible character issue in variable assignment.
* Improve error message for invalid whitespace

Updated error message to clarify invisible characters.
* Improve error handling for invisible characters

Updated error message for invisible characters in code.
* Document error for unknown token due to whitespace

Add error message for invalid whitespace in code
* Update error message for invalid whitespace handling
* Modify invalid_whitespace.rs for whitespace checks

Updated the test to check for invalid whitespace handling.
* Correct whitespace in variable declaration

Fix formatting issue by adding space around '=' in variable declaration.
* Update error message for invalid whitespace
* Update invalid_whitespace.stderr
* Refine error handling for invalid whitespace test

Update the error messages for invalid whitespace in the test.
* Update invalid_whitespace.rs
* Fix whitespace issues in invalid_whitespace.rs
* Update invalid_whitespace.stderr file
* Clean up whitespace in invalid_whitespace.rs

Removed unnecessary blank lines from the test file.
* Update invalid_whitespace.stderr
…yukang

tests: add whitespace tests for vertical tab behavior

This PR adds two small tests to highlight how vertical tab (\x0B)
is handled differently across Rust's whitespace definitions.

The Rust lexer treats vertical tab as whitespace (Unicode
Pattern_White_Space), while `split_ascii_whitespace` follows the
WhatWG Infra Standard and does not include vertical tab.

These tests make that difference visible and easier to understand.

See: rustfoundation/interop-initiative#53
…lace, r=chenyukang

Rewrite `FlatMapInPlace`.

Replace the hacky macro with a generic function and a new `FlatMapInPlaceVec` trait. More verbose but more readable and typical.

LLM disclosure: I asked Claude Code to critique this file and it suggested the generic function + trait idea. I implemented the idea entirely by hand.

r? @chenyukang
…-closure, r=wesleywiser

Fix wrong suggestion for returning async closure

Fixes rust-lang#150701

r? @estebank
…TaKO8Ki

Fix `#[expect(dead_code)]` liveness propagation

Fixes rust-lang#154324
Fixes rust-lang#152370 (cc @eggyal)

Previously, when traversing from a `ComesFromAllowExpect::Yes` item (i.e., with `#[allow(dead_code)]` or `#[expect(dead_code)]`), other `ComesFromAllowExpect::Yes` items reached during propagation would be updated to `ComesFromAllowExpect::No` and inserted into `live_symbols`. That caused `dead_code` lint couldn't be emitted correctly.

After this PR, `ComesFromAllowExpect::Yes` items no longer incorrectly update other `ComesFromAllowExpect::Yes` items during propagation or mark them live by mistake, then `dead_code` lint could behave as expected.
…anBrouwer,GuillaumeGomez

Move diagnostic attribute target checks from check_attr

Move diagnostic attribute target checks into their targets. Part of rust-lang#131229 (comment)

This is much easier with `emit_dyn_lint` :) (thanks @GuillaumeGomez !)

I think there might be some opportunity to simplify all these `check_diagnostic_*` methods in `check_attr`. However there are some diagnostic attribute prs in flight and I'd like to wait for those to land first and then think about it. So that PR is not for today.

r? @JonathanBrouwer (or @GuillaumeGomez if you want)
…rochenkov

Ensure we don't feed owners from ast lowering if we ever make that query tracked

follow-up to rust-lang#153489

I don't expect this to ever really be an issue, but better safe than sorry 😆
@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 (`#[…]`, `#![…]`) 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. labels Apr 21, 2026
@jhpratt
Copy link
Copy Markdown
Member Author

jhpratt commented Apr 21, 2026

@bors r+ rollup=never p=5

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Apr 21, 2026

📌 Commit b646067 has been approved by jhpratt

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 21, 2026
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Apr 21, 2026

☀️ Test successful - CI
Approved by: jhpratt
Duration: 3h 44m 44s
Pushing 3655153 to main...

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

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#151194 Fix wrong suggestion for returning async closure 5eaeef21cfa3ccf789875e9abe3b4b98ba409dc0 (link)
#154377 Fix #[expect(dead_code)] liveness propagation 40d0e95c2742827aa8738e0c6c6a43d7fddaaedd (link)
#155028 tests: add whitespace tests for vertical tab behavior c17ed83a63a795d2a54cde1751e1ca78661aefb9 (link)
#155572 Move diagnostic attribute target checks from check_attr 807babce2469c5c43494d2bdc76d0fc136cf2ee5 (link)
#155582 Rewrite FlatMapInPlace. 995964a12368ce51e51f0c8114c97c6a02a64667 (link)
#155586 Ensure we don't feed owners from ast lowering if we ever ma… 354023d520e0c7271bdc0a3fcd7f19de5025b720 (link)

previous master: 93637f398f

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 93637f3 (parent) -> 3655153 (this PR)

Test differences

Show 19 test diffs

Stage 1

  • [ui] tests/ui/lint/dead-code/expect-dead-code-152370.rs: [missing] -> pass (J1)
  • [ui] tests/ui/lint/dead-code/expect-dead-code-154324.rs: [missing] -> pass (J1)
  • [ui] tests/ui/lint/dead-code/expect-dead-code-field-read-in-dead-fn.rs: [missing] -> pass (J1)
  • [ui] tests/ui/lint/dead-code/expect-dead-code-through-non-expect-item.rs: [missing] -> pass (J1)
  • [ui] tests/ui/suggestions/suggest-create-closure-issue-150701.rs: [missing] -> pass (J1)
  • [ui] tests/ui/whitespace/ascii_whitespace_excludes_vertical_tab.rs: [missing] -> pass (J1)
  • [ui] tests/ui/whitespace/invalid_whitespace.rs: [missing] -> pass (J1)
  • [ui] tests/ui/whitespace/vertical_tab_lexer.rs: [missing] -> pass (J1)

Stage 2

  • [ui] tests/ui/lint/dead-code/expect-dead-code-152370.rs: [missing] -> pass (J0)
  • [ui] tests/ui/lint/dead-code/expect-dead-code-154324.rs: [missing] -> pass (J0)
  • [ui] tests/ui/lint/dead-code/expect-dead-code-field-read-in-dead-fn.rs: [missing] -> pass (J0)
  • [ui] tests/ui/lint/dead-code/expect-dead-code-through-non-expect-item.rs: [missing] -> pass (J0)
  • [ui] tests/ui/suggestions/suggest-create-closure-issue-150701.rs: [missing] -> pass (J0)
  • [ui] tests/ui/whitespace/ascii_whitespace_excludes_vertical_tab.rs: [missing] -> pass (J0)
  • [ui] tests/ui/whitespace/invalid_whitespace.rs: [missing] -> pass (J0)
  • [ui] tests/ui/whitespace/vertical_tab_lexer.rs: [missing] -> pass (J0)

Additionally, 3 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 365515367b4a20a315ec65a466991441b9dfba66 --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. pr-check-1: 26m 43s -> 33m 35s (+25.8%)
  2. i686-msvc-1: 3h 3m -> 2h 25m (-21.1%)
  3. x86_64-gnu-miri: 1h 21m -> 1h 37m (+20.9%)
  4. optional-x86_64-gnu-parallel-frontend: 2h 16m -> 2h 43m (+20.0%)
  5. dist-powerpc64le-linux-gnu: 1h 36m -> 1h 17m (-19.4%)
  6. x86_64-gnu-llvm-22-2: 1h 25m -> 1h 41m (+18.8%)
  7. dist-powerpc-linux: 1h 28m -> 1h 12m (-18.2%)
  8. test-various: 1h 49m -> 2h 8m (+16.8%)
  9. x86_64-rust-for-linux: 45m 57s -> 53m 33s (+16.6%)
  10. x86_64-gnu-tools: 56m 4s -> 1h 5m (+16.1%)
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 (3655153): comparison URL.

Overall result: ❌✅ regressions and improvements - please read:

Our benchmarks found a performance regression caused by this PR.
This might be an actual regression, but it can also be just noise.

Next Steps:

  • If the regression was expected or you think it can be justified,
    please write a comment with sufficient written justification, and add
    @rustbot label: +perf-regression-triaged to it, to mark the regression as triaged.
  • If you think that you know of a way to resolve the regression, try to create
    a new PR with a fix for the regression.
  • If you do not understand the regression or you think that it is just noise,
    you can ask the @rust-lang/wg-compiler-performance working group for help (members of this group
    were already notified of this PR).

@rustbot label: +perf-regression
cc @rust-lang/wg-compiler-performance

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)
1.0% [0.3%, 2.1%] 14
Regressions ❌
(secondary)
0.6% [0.6%, 0.7%] 7
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.2% [-0.2%, -0.2%] 3
All ❌✅ (primary) 1.0% [0.3%, 2.1%] 14

Max RSS (memory usage)

Results (primary -2.0%, secondary -3.1%)

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)
- - 0
Improvements ✅
(primary)
-2.0% [-2.0%, -2.0%] 1
Improvements ✅
(secondary)
-3.1% [-3.1%, -3.1%] 1
All ❌✅ (primary) -2.0% [-2.0%, -2.0%] 1

Cycles

Results (primary 2.4%)

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

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

Binary size

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

Bootstrap: 492.256s -> 490.033s (-0.45%)
Artifact size: 394.33 MiB -> 394.42 MiB (0.02%)

@rustbot rustbot added the perf-regression Performance regression. label Apr 21, 2026
@jhpratt jhpratt deleted the rollup-zyXU16X branch April 21, 2026 19:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) merged-by-bors This PR was explicitly merged by bors. perf-regression Performance regression. rollup A PR which is a rollup T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants