Skip to content

Rollup of 7 pull requests#158595

Merged
rust-bors[bot] merged 21 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-vgnGLp0
Jun 30, 2026
Merged

Rollup of 7 pull requests#158595
rust-bors[bot] merged 21 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-vgnGLp0

Conversation

@JonathanBrouwer

@JonathanBrouwer JonathanBrouwer commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

View all comments

Successful merges:

r? @ghost

Create a similar rollup

Rohan-Singla and others added 21 commits June 18, 2026 15:23
Currently, rustc can emit a FatalError diagnostic during parsing of
literals and tokenstreams. These are handled under the hood as a panic,
which means that proc-macro code needed to catch_unwind if it wanted to
fallibly parse some code. These still emit diagnostics, so in practice
this isn't a full fix, but it at least makes the interface on the macro
side a bit more uniform.

This is primarily motivated by wasm proc macros which can't use
catch_unwind and so this lets the test's output be the same with and
without them.
* refactor: move attribute and keywords docs files to core
* fix references to `std`
* tidy fixes
* ignore doc tests w/ explicit_tail_calls
* revert `unsafe` example and ignore specifically WASM for `become` doc tests
* add explicit note about doube including the docs in `core` and `std`
* missed refactoring of doc test ignore
* conditionally exclude doc-test containing threading for `wasm-wasip1`
* Change exclusion to just `wasi` target_os

Co-authored-by: Justin Schilleman <97192655+jschillem@users.noreply.github.com>
Before it would just show the `ensure` function
Sometimes it is necessary to group patchable function entrypoint
records in distinct linker sections. This is the case for some bpf
functions within the linux kernel which shouldn't be visible to
ftrace.

Extend `-Zpatchable-function-entry` to accept an argument of the form
`prefix_nops,total_nops,record_section`, which places all entry
record into a user specified section.

Likewise, extend the `patchable_function_entry` attribute to accept an
optional `section="name"` option to place a function into a specific
section.

This is made possible by llvm attribute `patchable-function-entry-section`
added in llvm 21.
… r=kobzol,mark-simulacrum,bjorn3

bootstrap: fix panic when repo path contains spaces by switching to CARGO_ENCODED_RUSTFLAGS

Fixes rust-lang#158052
Closes: rust-lang#156096

  ## Problem

  `./x build` panics with a cryptic assertion error when the repository is
  checked out under a directory path containing spaces (e.g.
  `/Users/foo/Open Source/rust`):

  thread 'main' panicked at src/bootstrap/src/core/builder/cargo.rs:54:9:
  assertion left == right failed
    left: 2
   right: 1

  The root cause: when building tools in `ToolRustcPrivate` or `Codegen`
  mode, bootstrap calls `llvm-config --libdir` and passes the result as a
  `-Clink-arg=-L<path>` rustflag. The `Rustflags::arg()` method asserted
  that arguments contain no spaces, but if the repo path has a space the
  libdir path inherits it and the assertion fires. The error gives no hint
  that the path is the problem.

  A secondary bug: `llvm-config --libdir` output has a trailing newline
  that was previously stripped accidentally by `RUSTFLAGS` whitespace
  splitting. Nothing was trimming it explicitly.

  ## Fix

  Two changes in `src/bootstrap/src/core/builder/cargo.rs`:

  1. **Switch `RUSTFLAGS` → `CARGO_ENCODED_RUSTFLAGS`**: Change
     `Rustflags` to store args as `Vec<String>` and join with `\x1f`
     (ASCII unit separator) when setting the env var. Cargo's
     `CARGO_ENCODED_RUSTFLAGS` (stable since Cargo 1.55) uses `\x1f` as
     delimiter, which never appears in filesystem paths, so paths with
     spaces are handled correctly. The space-based assertion in `arg()` is
     removed.

  2. **Trim `llvm-config --libdir` output**: Explicitly `.trim()` the
     captured stdout so the trailing newline is not included in the linker
     search path.

  `RUSTDOCFLAGS` is left as-is (space-joined) since no llvm paths are
  added to rustdocflags.

cc: @Kobzol
…g, r=bjorn3

Avoid parser panics bubbling out to proc macros

Currently, rustc can emit a FatalError diagnostic during parsing of literals and tokenstreams. These are handled under the hood as a panic, which means that proc-macro code needed to catch_unwind if it wanted to fallibly parse some code. These still emit diagnostics, so in practice this isn't a full fix, but it at least makes the interface on the macro side a bit more uniform. The long-term fix should be to get rid of those FatalErrors (and in general all diagnostics that actually get emitted out during parsing, not just returned), but this seems like a reasonable improvement in the meantime.

This is primarily motivated by wasm proc macros which can't use catch_unwind and so this lets the test's output be the same with and without them.

r? bjorn3
…tests-rustdoc, r=Kobzol

Avoid building rustdoc for tests without doctests

Fixes rust-lang#158299
…er, r=jieyouxu

Improve tracing of steps in bootstrap

Found this useful while debugging rust-lang#158299.

r? @jieyouxu
Allow section override when using patchable-function-entries

Sometimes it is necessary to group patchable function entrypoint records in distinct linker sections. This is the case for some bpf functions within the linux kernel which shouldn't be visible to ftrace.

Extend `-Zpatchable-function-entry` to accept an argument of the form `prefix_nops,total_nops,record_section`, which places all entry record into a user specified section.

Likewise, extend the `patchable_function_entry` attribute to accept an optional `section="name"` option to place a function into a specific section.

This is made possible by llvm attribute `patchable-function-entry-section` added in llvm 21.
…-keywords-to-core, r=GuillaumeGomez

Move attribute and keyword docs from `std` to `core`

Move the documentation for attributes and keywords into the `core` crate. Apart from strictly moving the module, I had to make a few small changes to certain docs to avoid using `std` types when possible, as well as fixing a few suggestions related to linking to primitives.

Pre-requisite for work on rust-lang#157604.

r? @GuillaumeGomez

Verified documentation using:
`./x doc library/core` and `./x doc library/std`, as well as running doc-tests for both crates.
…d-parens-space, r=nnethercote

Fix spacing issue for unused parentheses lint

There is a typo.

Fixes rust-lang#158583
@rust-bors rust-bors Bot added the rollup A PR which is a rollup label Jun 30, 2026
@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Jun 30, 2026
@JonathanBrouwer

Copy link
Copy Markdown
Contributor Author

@bors r+ rollup=never p=5

@rust-bors

rust-bors Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

📌 Commit cdfa297 has been approved by JonathanBrouwer

It is now in the queue for this repository.

@jhpratt

jhpratt commented Jun 30, 2026

Copy link
Copy Markdown
Member

@bors retry

@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 Jun 30, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Jun 30, 2026
…uwer

Rollup of 7 pull requests

Successful merges:

 - #158073 (bootstrap: fix panic when repo path contains spaces by switching to CARGO_ENCODED_RUSTFLAGS)
 - #158256 (Avoid parser panics bubbling out to proc macros)
 - #158561 (Avoid building rustdoc for tests without doctests)
 - #158562 (Improve tracing of steps in bootstrap)
 - #157445 (Allow section override when using patchable-function-entries)
 - #158327 (Move attribute and keyword docs from `std` to `core`)
 - #158591 (Fix spacing issue for unused parentheses lint)
@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

The job dist-arm-linux-gnueabi failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)

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

rust-bors Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

💔 Test for 3873d4d failed: CI. Failed job:

@JonathanBrouwer

Copy link
Copy Markdown
Contributor Author

@bors retry
@bors try jobs=dist-arm-linux-gnueabi

@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 Jun 30, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Jun 30, 2026
Rollup of 7 pull requests


try-job: dist-arm-linux-gnueabi
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Jun 30, 2026
…uwer

Rollup of 7 pull requests

Successful merges:

 - #158073 (bootstrap: fix panic when repo path contains spaces by switching to CARGO_ENCODED_RUSTFLAGS)
 - #158256 (Avoid parser panics bubbling out to proc macros)
 - #158561 (Avoid building rustdoc for tests without doctests)
 - #158562 (Improve tracing of steps in bootstrap)
 - #157445 (Allow section override when using patchable-function-entries)
 - #158327 (Move attribute and keyword docs from `std` to `core`)
 - #158591 (Fix spacing issue for unused parentheses lint)
@JonathanBrouwer

Copy link
Copy Markdown
Contributor Author

@bors p=4
@bors yield

@rust-bors

rust-bors Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Auto build was cancelled. Cancelled workflows:

The next pull request likely to be tested is #158593.

@rust-bors

rust-bors Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: d7f8235 (d7f8235a41f2666b5092c831e8301c6a23ec4b28)
Base parent: 0966944 (096694416a41840709140eb0fd0ca193d1a3e6ba)

@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 Jun 30, 2026
@rust-bors

rust-bors Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

☀️ Test successful - CI
Approved by: JonathanBrouwer
Duration: 3h 36m 12s
Pushing 5165714 to main...

@rust-bors rust-bors Bot merged commit 5165714 into rust-lang:main Jun 30, 2026
15 checks passed
@rustbot rustbot added this to the 1.98.0 milestone Jun 30, 2026
@rust-timer

Copy link
Copy Markdown
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#158073 bootstrap: fix panic when repo path contains spaces by swit… 7ab9f5ae5709359b389719db0818a16aa63d8083 (link)
#158256 Avoid parser panics bubbling out to proc macros 0c80361a91ec27f74191263ea1a216ec3d34ba82 (link)
#158561 Avoid building rustdoc for tests without doctests 2a7da652442fa52f2387f6a300b9dc0feada13e4 (link)
#158562 Improve tracing of steps in bootstrap 44763f5cb2d1ec4d70729d75e937b547beaa5244 (link)
#157445 Allow section override when using patchable-function-entries 6336758734941cbc509bfde5ee98e605e8784c99 (link)
#158327 Move attribute and keyword docs from std to core 33deb111ef9bda242be1f9d5abe3ee04e8b1a568 (link)
#158591 Fix spacing issue for unused parentheses lint 7daaabdacf4cffd382c4480ea6783dc68c20e28e (link)

previous master: 345632878c

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 3456328 (parent) -> 5165714 (this PR)

Test differences

Show 726 test diffs

Stage 0

  • core::builder::tests::snapshot::test_library_tests_only_does_not_build_rustdoc: [missing] -> pass (J3)

Stage 1

  • [codegen] tests/codegen-llvm/patchable-function-entry/patchable-function-entry-section.rs: [missing] -> pass (J1)
  • [ui (polonius)] tests/ui/lint/unused-parens-trailing-space-issue-158583.rs: [missing] -> pass (J4)
  • [ui] tests/ui/lint/unused-parens-trailing-space-issue-158583.rs: [missing] -> pass (J5)

Stage 2

  • [ui] tests/ui/lint/unused-parens-trailing-space-issue-158583.rs: [missing] -> pass (J0)
  • [codegen] tests/codegen-llvm/patchable-function-entry/patchable-function-entry-section.rs: [missing] -> pass (J2)

Additionally, 720 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 51657149e91586571ff1c463bc58239daa1a88d2 --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. test-various: 1h 12m -> 2h 37m (+118.0%)
  2. x86_64-gnu-gcc-core-tests: 8m 31s -> 15m 18s (+79.7%)
  3. dist-x86_64-msvc-alt: 1h 34m -> 2h 36m (+65.6%)
  4. i686-msvc-2: 2h 3m -> 1h 14m (-39.6%)
  5. dist-x86_64-apple: 2h 55m -> 1h 54m (-34.5%)
  6. tidy: 2m 33s -> 3m 20s (+30.7%)
  7. dist-powerpc64-linux-gnu: 1h 30m -> 1h 6m (-26.6%)
  8. optional-x86_64-gnu-parallel-frontend: 2h 24m -> 2h 55m (+22.1%)
  9. aarch64-apple-macos-26: 2h 46m -> 3h 20m (+20.3%)
  10. armhf-gnu: 1h 20m -> 1h 36m (+19.7%)
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 (5165714): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

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

Max RSS (memory usage)

Results (primary 1.2%, 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)
1.2% [1.2%, 1.2%] 1
Regressions ❌
(secondary)
7.6% [2.2%, 13.2%] 5
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.6% [-3.6%, -1.6%] 4
All ❌✅ (primary) 1.2% [1.2%, 1.2%] 1

Cycles

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

Binary size

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

Bootstrap: 490.57s -> 486.893s (-0.75%)
Artifact size: 393.68 MiB -> 393.67 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-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. merged-by-bors This PR was explicitly merged by bors. rollup A PR which is a rollup T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.