Rollup of 7 pull requests#158595
Conversation
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
|
@bors r+ rollup=never p=5 |
|
@bors retry |
This comment has been minimized.
This comment has been minimized.
…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)
|
The job Click to see the possible cause of the failure (guessed by this bot) |
|
💔 Test for 3873d4d failed: CI. Failed job:
|
This comment has been minimized.
This comment has been minimized.
Rollup of 7 pull requests try-job: dist-arm-linux-gnueabi
This comment has been minimized.
This comment has been minimized.
…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)
|
Auto build was cancelled. Cancelled workflows: The next pull request likely to be tested is #158593. |
This comment has been minimized.
This comment has been minimized.
|
📌 Perf builds for each rolled up PR:
previous master: 345632878c In the case of a perf regression, run the following command for each PR you suspect might be the cause: |
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 differencesShow 726 test diffsStage 0
Stage 1
Stage 2
Additionally, 720 doctest diffs were found. These are ignored, as they are noisy. Job group index
Test dashboardRun cargo run --manifest-path src/ci/citool/Cargo.toml -- \
test-dashboard 51657149e91586571ff1c463bc58239daa1a88d2 --output-dir test-dashboardAnd then open Job duration changes
How to interpret the job duration changes?Job durations can vary a lot, based on the actual runner instance |
|
Finished benchmarking commit (5165714): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis 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.
CyclesThis perf run didn't have relevant results for this metric. Binary sizeThis perf run didn't have relevant results for this metric. Bootstrap: 490.57s -> 486.893s (-0.75%) |
View all comments
Successful merges:
stdtocore#158327 (Move attribute and keyword docs fromstdtocore)r? @ghost
Create a similar rollup