-
Notifications
You must be signed in to change notification settings - Fork 13.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rollup of 8 pull requests #138388
Rollup of 8 pull requests #138388
Conversation
This improves the useability of heaps for priority-based work queues. In certain scenarios, modifications on the most relevant or critical items are performed until a condition that determines the work items have been sufficiently addressed. The loop will repeatedly access the most critical item and put it back in a sorted position when it is complete. Crucially, due to the ordering invariant we know that all work was performed when the completed item remains the most critical. Getting this information from the heap position avoids a (potentially more costly) check on the item state itself. A customized `drop` with boolean result would avoid up to two more comparisons performed in both the last no-op refresh and Drop code but this occurs once in each execution of the above scenario whereas refresh occurs any number of times. Also note that the comparison overhead of Drop is only taken if the element is mutably inspected to determine the end condition, i.e. not when refresh itself is the break condition.
This fixes an issue where vendoring would fail if `rustc` is not in PATH. This happens with the update of some workspaces to the 2024 edition which need to run `rustc -Vv` to determine which rust version is in use.
This is never hit in the test suite. At some point the check should be removed entirely. There are a million places in the compiler where an empty symbol doesn't make sense, so a check of this nature has almost zero value. But I'll leave it in place for now just in case it gets hit by fuzzing or in the wild.
Replace it with an assert for now, just in case it is reachable.
The idea is to identify cases of symbols/identifiers that are not expected to be used. There isn't a perfectly sharp line between "dummy" and "not dummy", but I think it's useful nonetheless.
`adjust_ident_and_get_scope` returns the symbol it receives unchanged, and the call site ignores the returned symbol, so this symbol is unused.
It has a single call site. The removal of the closure argument is a nice touch.
…, r=dtolnay Add PeekMut::refresh I'm not sure if this should go through ACP or not. BinaryHeap is not the most critical data structure in the standard library and it would be understandable if maintainer throughput is thus too limited to accept this PR without a proper design phase that ensures the required understanding of consequence over a longer time period. This aims to improve the useability of heaps for priority-based work queues. In certain scenarios, modifications on the most relevant or critical items are performed until a condition that determines the work items have been sufficiently addressed. For instance the criticality could be a deadline that is relaxed whenever some part of a work item is completed. Such a loop will repeatedly access the most critical item and put it back in a sorted position when it is complete. Crucially, due to the ordering invariant we know that all necessary work was performed when the completed item remains the most critical. Getting this information from the heap position avoids a (potentially more costly) check on the item state itself. A customized `drop` with boolean result would avoid up to two more comparisons performed in both the last no-op refresh and Drop code but this occurs once in each execution of the above scenario whereas refresh occurs any number of times. Also note that the comparison overhead of Drop is only taken if the element is mutably inspected to determine the end condition, i.e. not when refresh itself is the break condition.
…elf-pred, r=BoxyUwU Elaborate trait assumption in `receiver_is_dispatchable` Fixes rust-lang#138172. See comment on the linked test. Probably not a fix for the general problem, bc I think this may still be incomplete for other weird `where` clauses on the receiver. But 🤷, supertraits seems like an obvious one to fix.
Update books ## rust-lang/book 11 commits in 4a01a9182496f807aaa5f72d93a25ce18bcbe105..81a976a237f84b8392c4ce1bd5fd076eb757a2eb 2025-02-27 22:10:41 UTC to 2025-02-24 18:36:27 UTC - Ch. 10: Make social media discussion generic. (rust-lang/book#4249) - Another Ch. 17 -> 18 fix (rust-lang/book#4247) - Ch. 05: further tweak to wording about `user1` availability (rust-lang/book#4246) - Ch. 02: Fix rand version mistake (from testing) (rust-lang/book#4245) - Ch. 19: Correct the discussion of `fn` type and closures (rust-lang/book#4244) - Edition maintenance: scripting the updates for future work (rust-lang/book#4243) - Ch. 17: fresh-eyes edits (rust-lang/book#4242) - Ch. 17: drop lifetime not required in 2024 Edition (rust-lang/book#4212) - Appendix B, Operators: Replace “member access” with “field access” and “method call”. (rust-lang/book#4240) - Update to Rust 1.85 and 2024 Edition! (rust-lang/book#4241) - Chapter 1: fix 'four things' now that spacing is not emphasized (rust-lang/book#4239) ## rust-lang/edition-guide 2 commits in daa4b763cd848f986813b5cf8069e1649f7147af..1e27e5e6d5133ae4612f5cc195c15fc8d51b1c9c 2025-03-04 22:02:00 UTC to 2025-02-26 12:47:41 UTC - Mention both `rustfmt.toml` and `.rustfmt.toml` (rust-lang/edition-guide#372) - Fix a typo (rust-lang/edition-guide#370) ## rust-lang/nomicon 1 commits in 8f5c7322b65d079aa5b242eb10d89a98e12471e1..b4448fa406a6dccde62d1e2f34f70fc51814cdcc 2025-03-01 04:48:05 UTC to 2025-03-01 04:48:05 UTC - Update to 2024 edition (rust-lang/nomicon#481) ## rust-lang/reference 8 commits in 615b4cec60c269cfc105d511c93287620032d5b0..dda31c85f2ef2e5d2f0f2f643c9231690a30a626 2025-03-09 14:25:25 UTC to 2025-02-25 16:07:17 UTC - Rework note blocks and change admonition rendering (rust-lang/reference#1754) - Add more information on rules and tests (rust-lang/reference#1753) - Mention `explicit_builtin_cfgs_in_flags` lint cfg chapter (rust-lang/reference#1747) - fixup test links (rust-lang/reference#1741) - Fix diagnostics typo: `do_no_recommend` -> `do_not_recommend` (rust-lang/reference#1749) - panic runtime and C-unwind documentation (rust-lang/reference#1226) - Closures: fix example of desugaring (rust-lang/reference#1743) - Update boolean.md, Comment breaks paragraph format (rust-lang/reference#1744) ## rust-lang/rust-by-example 1 commits in 66543bbc5b7dbd4e679092c07ae06ba6c73fd912..6f69823c28ae8d929d6c815181c73d3e99ef16d3 2025-03-09 13:12:24 UTC to 2025-03-09 13:12:24 UTC - Update mdbook to 0.4.46 (rust-lang/rust-by-example#1914) try-job: x86_64-gnu-distcheck
…piler-errors Reduce `kw::Empty` usage, part 2 A few small `kw::Empty` removals, or steps toward removals. r? fmease
…ywiser Fix false-positive in `expr_or_init` and in the `invalid_from_utf8` lint This PR fixes the logic for finding initializer in the `expr_or_init` and `expr_or_init_with_outside_body` functions. If the binding were to be mutable (`let mut`), the logic wouldn't consider that the initializer expression could have been modified and would return the init expression even-trough multiple subsequent assignments could have been done. Example: ```rust let mut a = [99, 108, 130, 105, 112, 112]; // invalid, not UTF-8 loop { a = *b"clippy"; // valid break; } std::str::from_utf8_mut(&mut a); // currently warns, with this PR it doesn't ``` This PR modifies the logic to excludes mutable let bindings. Found when using `expr_or_init` in rust-lang#119220. r? compiler
Refactor `pick2_mut` & `pick3_mut` to use `get_disjoint_mut` Closes rust-lang#138196
…cursors, r=compiler-errors Item-related cleanups I have been looking at `hir::Item` closely and found a few minor cleanup opportunities. r? ```@spastorino```
…mpiler-errors Remove unnecessary lifetime from `PatInfo`. r? ```@jackh726```
@bors r+ rollup=never p=5 |
The job Click to see the possible cause of the failure (guessed by this bot)
|
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#138161 (Add PeekMut::refresh) - rust-lang#138174 (Elaborate trait assumption in `receiver_is_dispatchable`) - rust-lang#138313 (Update books) - rust-lang#138347 (Reduce `kw::Empty` usage, part 2) - rust-lang#138360 (Fix false-positive in `expr_or_init` and in the `invalid_from_utf8` lint) - rust-lang#138372 (Refactor `pick2_mut` & `pick3_mut` to use `get_disjoint_mut`) - rust-lang#138376 (Item-related cleanups) - rust-lang#138377 (Remove unnecessary lifetime from `PatInfo`.) r? `@ghost` `@rustbot` modify labels: rollup
Hm, gcc mirrors again... |
@bors retry |
⌛ Testing commit 76f9cda with merge 57a4736e9f4b7e8089b2db60583607f3b550c862... |
☀️ Test successful - checks-actions |
Post-merge analysis result Test differences
(and 18 additional diffs) |
📌 Perf builds for each rolled up PR:
previous master: a21d9789e2 In the case of a perf regression, run the following command for each PR you suspect might be the cause: |
Finished benchmarking commit (57a4736): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)Results (primary -3.8%, secondary -3.2%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResults (secondary 2.2%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 779.599s -> 779.955s (0.05%) |
Successful merges:
receiver_is_dispatchable
#138174 (Elaborate trait assumption inreceiver_is_dispatchable
)kw::Empty
usage, part 2 #138347 (Reducekw::Empty
usage, part 2)expr_or_init
and in theinvalid_from_utf8
lint #138360 (Fix false-positive inexpr_or_init
and in theinvalid_from_utf8
lint)pick2_mut
&pick3_mut
to useget_disjoint_mut
#138372 (Refactorpick2_mut
&pick3_mut
to useget_disjoint_mut
)PatInfo
. #138377 (Remove unnecessary lifetime fromPatInfo
.)r? @ghost
@rustbot modify labels: rollup
Create a similar rollup