Rollup of 12 pull requests#155472
Conversation
For `gnu` function_sections is off by default.
This creates an empty iterator, like `repeat_n(value, 0)` but without needing any such value at hand. There's precedent in many other iterators that the `Default` is empty, like `slice::Iter`. I found myself wanting this for rayon's `RepeatN` as it lowers to a sequential iterator [here][1]. Since rayon is also optimizing to avoid extra clones, it may end up with parallel splits that have count 0 and no item value. Calling `std::iter::repeat_n(x, 0)` just drops that value, but there's no way to construct the same result without a value yet. This would be straightforward with an empty `Default`. [1]: https://github.com/rayon-rs/rayon/blob/ae07384e3e0b238cea89f0c14891f351c65a5cee/src/iter/repeat.rs#L201-L202
The one where this was copied from has since been updated.
All but one of the bullet points ended with a period; add the missing period.
…, r=Amanieu naked functions: respect `function-sections` fixes rust-lang#147789 r? @Amanieu
…cottmcm Add Sized supertrait for CoerceUnsized and DispatchFromDyn This is part of rust-lang#149094. I did not include `Receiver` because I think it is correct to allow non-sized receivers.
…gross35 `impl Default for RepeatN` This creates an empty iterator, like `repeat_n(value, 0)` but without needing any such value at hand. There's precedent in many other iterators that the `Default` is empty, like `slice::Iter`. I found myself wanting this for rayon's `RepeatN` as it lowers to a sequential iterator [here][1]. Since rayon is also optimizing to avoid extra clones, it may end up with parallel splits that have count 0 and no item value. Calling `std::iter::repeat_n(x, 0)` just drops that value, but there's no way to construct the same result without a value yet. This would be straightforward with an empty `Default`. [1]: https://github.com/rayon-rs/rayon/blob/ae07384e3e0b238cea89f0c14891f351c65a5cee/src/iter/repeat.rs#L201-L202 r? libs-api (insta-stable)
`std::any::TypeId`: remove misplaced "and" in `Unique<T>` example
Move recursion out of `MatchPairTree::for_pattern` helpers The helper functions now just iterate over the relevant subpatterns, while leaving recursion up to the main function. This avoids passing parameters that were only used for recursive plumbing, and consolidates all recursive calls into `for_pattern` itself, which should make it easier to experiment with changes to the recursive structure. There should be no change to compiler behaviour.
…itor Fix misleading "borrowed data escapes outside of function" diagnostic Fixes rust-lang#154350 Fall back to `report_general_error()` when `fr_name_and_span` is `None` in function items, since the "escaping data" framing is only appropriate for closures capturing outside variables.
…th_addr, r=scottmcm ptr: update text in intro text to one in with_addr doc The one where this was copied from has since been updated.
Fix ICE in borrowck mutability suggestion with multi-byte ref sigil Fixes rust-lang#139089 Similarly to rust-lang#155068, this is another instance where span arithmetic did not account for multi-byte characters. (Note that the ampersand in the test is full-width) This change also results in correcting some inappropriate suggestions.
rustdoc: Fix `redundant_explicit_links` incorrectly firing (or not firing) under certain scenarios Hi! I found some issues with the `rustdoc::redundant_explicit_links` lint while working on a personal project. - After skipping a link that contains inline markups, the lint would incorrectly skip all the remaining links. For example, with the following snippet, the lint is fired for `[Option][Option]`, but not `[Result][Result]`: ```rs //! [Option][Option] //! [**u8**][u8] (skipped) //! [Result][Result] ``` Happening because of a `?` causing a loop to bail early: https://github.com/rust-lang/rust/blob/a4a37ed163a6c1d227b58047d91457589c611cf8/src/librustdoc/passes/lint/redundant_explicit_links.rs#L107 - The lint is fired for links that specify titles (like `[link](link "title")`), except that wouldn't be applicable because it's not possible to specify a title without there also being an explicit target. For example: ``` error: redundant explicit link target --> <anon>:5:12 | 5 | /// [drop](drop "This function is not magic") | ---- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ explicit target is redundant | | | because label contains path that resolves to same destination | = note: when a link's destination is not specified, the label is used to resolve intra-doc links help: remove explicit link target | 5 - /// [drop](drop "This function is not magic") 5 + /// [drop] | ``` These are found as of: ``` rustdoc 1.97.0-nightly (1b8f2e4 2026-04-17) binary: rustdoc commit-hash: 1b8f2e4 commit-date: 2026-04-17 host: aarch64-apple-darwin release: 1.97.0-nightly LLVM version: 22.1.2 ``` (Note: I ran `./x test tests/rustdoc-ui` locally, but not `./x tidy` due to my slow internet. There was an unrelated failed test at `tests/rustdoc-ui/ice-bug-report-url.rs` which I'm not sure about)
Remove unnecessary safety conditions related to unchecked uint arithmetic Improve the safety documentation of three unsafe APIs related to unsigned integer arithmetic. - [unchecked_add](https://doc.rust-lang.org/nightly/core/primitive.usize.html#method.unchecked_add): It is impossible for `self + rhs < usize::MIN`. - [unchecked_sub](https://doc.rust-lang.org/nightly/core/primitive.usize.html#method.unchecked_sub): It is impossible for `self - rhs > usize::MAX`. - [unchecked_mul](https://doc.rust-lang.org/nightly/core/primitive.usize.html#method.unchecked_mul): It is impossible for `self * rhs < usize::MIN`. The examples use `usize` for demonstration. All unsigned integer types suffer from the same issue because their APIs are generated by the same macro `uint_impl`, and fixing the macro documentation will fix them all.
docs: Fix typo in std/src/thready/scoped.rs # Fix typo in std/src/thread/scoped.rs ## Why this pr This PR fixes the typo mentioned in rust-lang#155275. I know this was originally fixed in rust-lang#155325 and then in rust-lang#155328. But since the first issue was closed due to some ai slop and the second one was closed because the first one was already opened, it seems to me that this PR is still needed. ## What this pr does This PR "just" fixes a typo inside the `std/src/thread/scoped.rs` file Changing the comment from this: ``` /// borrow non-`'static` data from the outside the scope. See [`scope`] for /// details. ``` to this: ``` /// borrow non-`'static` data from outside the scope. See [`scope`] for /// details. ```
`std::error::Request`: clean up documentation
|
@bors r+ rollup=never p=5 |
This comment has been minimized.
This comment has been minimized.
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 2f201bc (parent) -> 7a38981 (this PR) Test differencesShow 233 test diffsStage 1
Stage 2
Additionally, 178 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 7a38981b365e4c3672053b910fce9a14c6555ab9 --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 |
|
📌 Perf builds for each rolled up PR:
previous master: 2f201bccb3 In the case of a perf regression, run the following command for each PR you suspect might be the cause: |
|
Finished benchmarking commit (7a38981): 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)This perf run didn't have relevant results for this metric. CyclesThis perf run didn't have relevant results for this metric. Binary sizeThis perf run didn't have relevant results for this metric. Bootstrap: 491.618s -> 492.147s (0.11%) |
Successful merges:
function-sections#147811 (naked functions: respectfunction-sections)impl Default for RepeatN#139690 (impl Default for RepeatN)std::any::TypeId: remove misplaced "and" inUnique<T>example #153511 (std::any::TypeId: remove misplaced "and" inUnique<T>example)MatchPairTree::for_patternhelpers #154943 (Move recursion out ofMatchPairTree::for_patternhelpers )redundant_explicit_linksincorrectly firing (or not firing) under certain scenarios #155435 (rustdoc: Fixredundant_explicit_linksincorrectly firing (or not firing) under certain scenarios)std::error::Request: clean up documentation #155467 (std::error::Request: clean up documentation)r? @ghost
Create a similar rollup