Skip to content
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

Merged
merged 28 commits into from
Jan 19, 2022
Merged

Rollup of 10 pull requests #93069

merged 28 commits into from
Jan 19, 2022

Commits on Oct 7, 2021

  1. 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.
    digama0 authored Oct 7, 2021
    Configuration menu
    Copy the full SHA
    3eb87db View commit details
    Browse the repository at this point in the history

Commits on Nov 27, 2021

  1. Configuration menu
    Copy the full SHA
    61ff847 View commit details
    Browse the repository at this point in the history

Commits on Dec 27, 2021

  1. 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 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.
    AngelicosPhosphoros committed Dec 27, 2021
    Configuration menu
    Copy the full SHA
    4b62a77 View commit details
    Browse the repository at this point in the history

Commits on Jan 4, 2022

  1. Update wording

    digama0 authored Jan 4, 2022
    Configuration menu
    Copy the full SHA
    b9f008b View commit details
    Browse the repository at this point in the history

Commits on Jan 5, 2022

  1. Configuration menu
    Copy the full SHA
    06b17a2 View commit details
    Browse the repository at this point in the history

Commits on Jan 11, 2022

  1. Configuration menu
    Copy the full SHA
    bd1f09d View commit details
    Browse the repository at this point in the history

Commits on Jan 15, 2022

  1. Configuration menu
    Copy the full SHA
    8b459dd View commit details
    Browse the repository at this point in the history

Commits on Jan 18, 2022

  1. Remove some unused Ord derivations based on DefId

    Removes `Ord` and `PartialOrd` from  middle::mir::mirsource, inlineasmoperand,
    terminatorkind, operand, constant, constantkind, and place
    pierwill committed Jan 18, 2022
    Configuration menu
    Copy the full SHA
    0882bbb View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    b160564 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    07a0325 View commit details
    Browse the repository at this point in the history
  4. Add Option::is_some_with.

    m-ou-se committed Jan 18, 2022
    Configuration menu
    Copy the full SHA
    282224e View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    aaebae9 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    148234f View commit details
    Browse the repository at this point in the history
  7. Improve is_err_with example.

    m-ou-se committed Jan 18, 2022
    Configuration menu
    Copy the full SHA
    45dee47 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    5f74ef4 View commit details
    Browse the repository at this point in the history
  9. Fix is_some_with tests.

    m-ou-se committed Jan 18, 2022
    Configuration menu
    Copy the full SHA
    5fee3e7 View commit details
    Browse the repository at this point in the history

Commits on Jan 19, 2022

  1. 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.
    jsha committed Jan 19, 2022
    Configuration menu
    Copy the full SHA
    fa9a843 View commit details
    Browse the repository at this point in the history
  2. Update books

    ehuss committed Jan 19, 2022
    Configuration menu
    Copy the full SHA
    84e0d9d View commit details
    Browse the repository at this point in the history
  3. Rollup merge of rust-lang#88642 - c410-f3r:let_chains_2, r=matthewjasper

    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
    matthiaskrgr authored Jan 19, 2022
    Configuration menu
    Copy the full SHA
    5d2928f View commit details
    Browse the repository at this point in the history
  4. Rollup merge of rust-lang#89621 - digama0:patch-2, r=yaahc

    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);
    ```
    matthiaskrgr authored Jan 19, 2022
    Configuration menu
    Copy the full SHA
    2a4381d View commit details
    Browse the repository at this point in the history
  5. Rollup merge of rust-lang#91278 - SparrowLii:place, r=spastorino

    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.
    matthiaskrgr authored Jan 19, 2022
    Configuration menu
    Copy the full SHA
    3a1db90 View commit details
    Browse the repository at this point in the history
  6. Rollup merge of rust-lang#92124 - AngelicosPhosphoros:remove_extra_al…

    …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.
    matthiaskrgr authored Jan 19, 2022
    Configuration menu
    Copy the full SHA
    3148a32 View commit details
    Browse the repository at this point in the history
  7. Rollup merge of rust-lang#92783 - FabianWolff:issue-92726, r=nikomats…

    …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`
    matthiaskrgr authored Jan 19, 2022
    Configuration menu
    Copy the full SHA
    9a82f74 View commit details
    Browse the repository at this point in the history
  8. Rollup merge of rust-lang#92797 - jsha:fewer-lines, r=GuillaumeGomez

    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`
    matthiaskrgr authored Jan 19, 2022
    Configuration menu
    Copy the full SHA
    7f2dbcb View commit details
    Browse the repository at this point in the history
  9. Rollup merge of rust-lang#92920 - dtolnay:printtidy, r=cjgillot

    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.
    matthiaskrgr authored Jan 19, 2022
    Configuration menu
    Copy the full SHA
    420ada6 View commit details
    Browse the repository at this point in the history
  10. Rollup merge of rust-lang#93041 - pierwill:rm-unused-defid-ords, r=cj…

    …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`
    matthiaskrgr authored Jan 19, 2022
    Configuration menu
    Copy the full SHA
    0b9056c View commit details
    Browse the repository at this point in the history
  11. Rollup merge of rust-lang#93051 - m-ou-se:is-some-with, r=yaahc

    Add Option::is_some_with and Result::is_{ok,err}_with
    
    See rust-lang#62358 (comment)
    matthiaskrgr authored Jan 19, 2022
    Configuration menu
    Copy the full SHA
    d5bc168 View commit details
    Browse the repository at this point in the history
  12. Rollup merge of rust-lang#93062 - ehuss:update-books, r=ehuss

    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.
    matthiaskrgr authored Jan 19, 2022
    Configuration menu
    Copy the full SHA
    ea1275a View commit details
    Browse the repository at this point in the history