-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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 10 pull requests #93069
Rollup of 10 pull requests #93069
Conversation
`slice::sort_by_cached_key` takes a caching function `f: impl FnMut(&T) -> K`, which means that the order that calls to the caching function are made is user-visible. This adds a clause to the documentation to promise the current behavior, which is that `f` is called on all elements of the slice from left to right, unless the slice has len < 2 in which case `f` is not called.
Old code already contain optimization for cases with `&str` and `&[u8]` args. This commit adds a specialization for `&mut[u8]` too. Also, I added usage of old slice in search for zero bytes instead of new buffer because it produce better code for Windows on LTO builds. For other platforms, this wouldn't cause any difference because it calls `libc` anyway. Inlined `_new` method into spec trait to reduce amount of code generated to `CString::new` callers.
Removes `Ord` and `PartialOrd` from middle::mir::mirsource, inlineasmoperand, terminatorkind, operand, constant, constantkind, and place
They are not needed to separate the search bar and the title, which are visually distinct on their own.
Formally implement let chains ## Let chains My longest and hardest contribution since rust-lang#64010. Thanks to `@Centril` for creating the RFC and special thanks to `@matthewjasper` for helping me since the beginning of this journey. In fact, `@matthewjasper` did much of the complicated MIR stuff so it's true to say that this feature wouldn't be possible without him. Thanks again `@matthewjasper!` With the changes proposed in this PR, it will be possible to chain let expressions along side local variable declarations or ordinary conditional expressions. In other words, do much of what the `if_chain` crate already does. ## Other considerations * `if let guard` and `let ... else` features need special care and should be handled in a following PR. * Irrefutable patterns are allowed within a let chain context * ~~Three Clippy lints were already converted to start dogfooding and help detect possible corner cases~~ cc rust-lang#53667
doc: guarantee call order for sort_by_cached_key `slice::sort_by_cached_key` takes a caching function `f: impl FnMut(&T) -> K`, which means that the order that calls to the caching function are made is user-visible. This adds a clause to the documentation to promise the current behavior, which is that `f` is called on all elements of the slice from left to right, unless the slice has len < 2 in which case `f` is not called. For example, this can be used to ensure that the following code is a correct way to involve the index of the element in the sort key: ```rust let mut index = 0; slice.sort_by_cached_key(|x| (my_key(index, x), index += 1).0); ```
Use iterator instead of recursion in `codegen_place` This PR fixes the FIXME in `codegen_place` about using iterator instead of recursion when processing the `projection` field in `mir::PlaceRef`. At the same time, it also reduces the right drift.
…loc_in_cstring_new_35838, r=Mark-Simulacrum Little improves in CString `new` when creating from slice Old code already contain optimization for cases with `&str` and `&[u8]` args. This commit adds a specialization for `&mut[u8]` too. Also, I added usage of old slice in search for zero bytes instead of new buffer because it produce better code for constant inputs on Windows LTO builds. For other platforms, this wouldn't cause any difference because it calls `libc` anyway. Inlined `_new` method into spec trait to reduce amount of code generated to `CString::new` callers.
…akis Annotate dead code lint with notes about ignored derived impls Fixes rust-lang#92726. CC `@pmetzger,` is this what you had in mind? r? `@nikomatsakis`
Remove horizontal lines at top of page They are not needed to separate the search bar and the title, which are visually distinct on their own. Part of rust-lang#59840 Demo: https://rustdoc.crud.net/jsha/fewer-lines/std/string/struct.String.html r? `@GuillaumeGomez`
Move expr- and item-related pretty printing functions to modules Currently *compiler/rustc_ast_pretty/src/pprust/state.rs* is 2976 lines on master. The `tidy` limit is 3000, which is blocking rust-lang#92243. This PR adds a `mod expr;` and `mod item;` to move logic related to those AST nodes out of the single huge file.
…gillot Remove some unused ordering derivations based on `DefId` Like rust-lang#93018, this removes some unused/unneeded ordering derivations as part of ongoing work on rust-lang#90317. Here, these changes are aimed at making rust-lang#90749 easier to review, test, and merge. r? `@cjgillot`
Add Option::is_some_with and Result::is_{ok,err}_with See rust-lang#62358 (comment)
Update books ## nomicon 1 commits in c05c452b36358821bf4122f9c418674edd1d713d..66d097d3d80e8f88c288c6879c7c2b909ecf8ad4 2021-12-13 15:23:48 +0900 to 2022-01-05 05:45:21 +0900 - Fix typo / type error in FFI code example (rust-lang/nomicon#327) ## reference 8 commits in f8ba2f12df60ee19b96de24ae5b73af3de8a446b..4dee6eb63d728ffb9e7a2ed443e9ada9275c69d2 2022-01-03 11:02:08 -0800 to 2022-01-18 09:26:33 -0800 - (minor) Remove Expression Path sub-types splits in Pattern specs (rust-lang/reference#1138) - Document destructuring assignment (rust-lang/reference#1116) - Document the 2021 edition changes to macros-by-example `pat` metavariables (rust-lang/reference#1135) - Improve the documentation of macros-by-example metavariable names (rust-lang/reference#1130) - trait-bounds.md: add pronoun 'that' (rust-lang/reference#1131) - Say that macros-by-example `ident` metavariables can match raw identifiers (rust-lang/reference#1133) - State in the UAX31 profile description that a lone `_` is not an identifier (rust-lang/reference#1129) - Document syntax reserved in Rust 2021 (rust-lang/reference#1128) ## book 17 commits in d3740fb7aad0ea4a80ae20f64dee3a8cfc0c5c3c..f17df27fc14696912c48b8b7a7a8fa49e648088d 2022-01-03 21:46:04 -0500 to 2022-01-18 17:46:28 -0500 - Add a notice to the top of all nostarch snapshots - Fix quotes - Grammar (minor): 'or' → 'and' for enum variants - Propagate edits of chapter 8 to src - Replies to nostarch edits - more edits - ch8 from nostarch - Fix grammar and line wrapping - Merge remote-tracking branch 'origin/pr/2880' - Remove wikipedia link - Merge remote-tracking branch 'origin/pr/2927' - Snapshot of ch14 for nostarch - Backport fixes to chapter 14 noticed while doing nostarch snapshot - Fix usage of find piped into xargs - Adjust some more line numbers of Cargo.toml includes - Merge branch '2909' - Merge remote-tracking branch 'parkerziegler/fix/ch14-add-one-naming' ## rustc-dev-guide 7 commits in 875464457c4104686faf667f47848aa7b0f0a744..78dd6a4684cf8d6b72275fab6d0429ea40b66338 2021-12-28 22:17:49 -0600 to 2022-01-18 14:44:26 -0300 - Reorganize and expand the testing chapters. (rust-lang/rustc-dev-guide#1281) - Add inline assembly internals (rust-lang/rustc-dev-guide#1266) - Spelling: Rename `rust` to `Rust` (rust-lang/rustc-dev-guide#1288) - Clean up section about FCPs (rust-lang/rustc-dev-guide#1287) - Address more review comments in rust-lang/rustc-dev-guide#1286. - Address review comments in rust-lang/rustc-dev-guide#1286. - Streamline "Getting Started" some more.
@bors r+ rollup=never p=10 |
📌 Commit ea1275a has been approved by |
⌛ Testing commit ea1275a with merge b551b2f59f2cae4cb2fb5c1619200cc3dbce2bc7... |
@bors retry Yield to 1.58.1. |
⌛ Testing commit ea1275a with merge 2ee697ed425bd9437a17bbdcd999ce9282e6ea11... |
@bors retry Yield to 1.58.1. |
⌛ Testing commit ea1275a with merge e68f9cea1486693faa5ff8f705d0758166579ca0... |
@bors retry Yield to 1.58.1. |
☀️ Test successful - checks-actions |
Finished benchmarking commit (5e57faa): comparison url. Summary: This benchmark run did not return any relevant changes. If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. @rustbot label: -perf-regression |
Hmm, the compare page looks to me like this should be flagged as a performance improvement: |
Successful merges:
codegen_place
#91278 (Use iterator instead of recursion incodegen_place
)new
when creating from slice #92124 (Little improves in CStringnew
when creating from slice)DefId
#93041 (Remove some unused ordering derivations based onDefId
)Failed merges:
r? @ghost
@rustbot modify labels: rollup
Create a similar rollup