Skip to content

Rollup of 7 pull requests#158595

Open
JonathanBrouwer wants to merge 21 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-vgnGLp0
Open

Rollup of 7 pull requests#158595
JonathanBrouwer wants to merge 21 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-vgnGLp0

Conversation

@JonathanBrouwer

Copy link
Copy Markdown
Contributor

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.

@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-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 fddf7e0 failed: CI. Failed job:

@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

A job failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
  TOOLSTATE_PUBLISH: 1
  IMAGE: arm-android
##[endgroup]
    Updating crates.io index
error: failed to get `askama_derive` as a dependency of package `askama_macros v0.16.0`
    ... which satisfies dependency `askama_macros = "=0.16.0"` of package `askama v0.16.0`
    ... which satisfies dependency `askama = "^0.16.0"` of package `citool v0.1.0 (/home/runner/work/rust/rust/src/ci/citool)`

Caused by:
  failed to load source for dependency `askama_derive`

Caused by:
  unable to update registry `crates-io`

Caused by:
  download of as/ka/askama_derive failed

Caused by:
  curl failed

Caused by:

@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

rust-bors Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

⌛ Testing commit cdfa297 with merge 0dd2d73...

Workflow: https://github.com/rust-lang/rust/actions/runs/28421962346

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

rust-bors Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

⌛ Testing commit cdfa297 with merge 5165714...

Workflow: https://github.com/rust-lang/rust/actions/runs/28431613791

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)
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. rollup A PR which is a rollup S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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.