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 7 pull requests #94491

Closed
wants to merge 18 commits into from

Commits on Feb 11, 2022

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

Commits on Mar 1, 2022

  1. Add helper function to suggest multiple constraints

    Add `rustc_middle::ty::suggest_constraining_type_params` that suggests
    adding multiple constraints.
    
    `suggest_constraining_type_param` now just forwards params to this new
    function.
    WaffleLapkin committed Mar 1, 2022
    Configuration menu
    Copy the full SHA
    4c7fb9e View commit details
    Browse the repository at this point in the history
  2. 7 - Make more use of let_chains

    Continuation of rust-lang#94376.
    
    cc rust-lang#53667
    c410-f3r committed Mar 1, 2022
    Configuration menu
    Copy the full SHA
    7aa5ea9 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    741553e View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    885e808 View commit details
    Browse the repository at this point in the history
  5. compiler: fix some typos

    cuishuang committed Mar 1, 2022
    Configuration menu
    Copy the full SHA
    eb2b944 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    765205b View commit details
    Browse the repository at this point in the history
  7. Suggest adding Copy bound when Adt is moved out

    Previously we've only suggested adding `Copy` bounds when the type being
    moved/copied is a type parameter (generic). With this commit we also
    suggest adding bounds when a type
    - Can be copy
    - All predicates that need to be satisfied for that are based on type
      params
    
    i.e. we will suggest `T: Copy` for `Option<T>`, but won't suggest
    anything for `Option<String>`.
    
    Future work: it would be nice to also suggest adding `.clone()` calls
    WaffleLapkin committed Mar 1, 2022
    Configuration menu
    Copy the full SHA
    400d343 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    879efa8 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    f0a16b8 View commit details
    Browse the repository at this point in the history
  10. Update books

    ehuss committed Mar 1, 2022
    Configuration menu
    Copy the full SHA
    8e04049 View commit details
    Browse the repository at this point in the history
  11. Rollup merge of rust-lang#93858 - krallin:process-process_group, r=dt…

    …olnay
    
    Add a `process_group` method to UNIX `CommandExt`
    
    - Tracking issue: rust-lang#93857
    - RFC: rust-lang/rfcs#3228
    
    Add a `process_group` method to `std::os::unix::process::CommandExt` that
    allows setting the process group id (i.e. calling `setpgid`) in the child, thus
    enabling users to set process groups while leveraging the `posix_spawn` fast
    path.
    matthiaskrgr committed Mar 1, 2022
    Configuration menu
    Copy the full SHA
    8689081 View commit details
    Browse the repository at this point in the history
  12. Rollup merge of rust-lang#94375 - WaffleLapkin:copy-suggestion, r=est…

    …ebank
    
    Adt copy suggestions
    
    Previously we've only suggested adding `Copy` bounds when the type being moved/copied is a type parameter (generic). With this PR we also suggest adding bounds when a type
    - Can be copy
    - All predicates that need to be satisfied for that are based on type params
    
    i.e. we will suggest `T: Copy` for `Option<T>`, but won't suggest anything for `Option<String>`.
    
    An example:
    ```rust
    fn duplicate<T>(t: Option<T>) -> (Option<T>, Option<T>) {
        (t, t)
    }
    ```
    New error (current compiler doesn't provide `help`:):
    ```text
    error[E0382]: use of moved value: `t`
     --> t.rs:2:9
      |
    1 | fn duplicate<T>(t: Option<T>) -> (Option<T>, Option<T>) {
      |                 - move occurs because `t` has type `Option<T>`, which does not implement the `Copy` trait
    2 |     (t, t)
      |      -  ^ value used here after move
      |      |
      |      value moved here
      |
    help: consider restricting type parameter `T`
      |
    1 | fn duplicate<T: Copy>(t: Option<T>) -> (Option<T>, Option<T>) {
      |               ++++++
    ```
    
    Fixes rust-lang#93623
    r? `@estebank`
    `@rustbot` label +A-diagnostics +A-suggestion-diagnostics +C-enhancement
    
    ----
    
    I'm not at all sure if this is the right implementation for this kind of suggestion, but it seems to work :')
    matthiaskrgr committed Mar 1, 2022
    Configuration menu
    Copy the full SHA
    38b1f1d View commit details
    Browse the repository at this point in the history
  13. Rollup merge of rust-lang#94433 - Urgau:check-cfg-allowness, r=petroc…

    …henkov
    
    Improve allowness of the unexpected_cfgs lint
    
    This pull-request improve the allowness (`#[allow(...)]`) of the `unexpected_cfgs` lint.
    
    Before this PR only crate level `#![allow(unexpected_cfgs)]` worked, now with this PR it also work when put around `cfg!` or if it is in a upper level. Making it work ~for the attributes `cfg`, `cfg_attr`, ...~ for the same level is awkward as the current code is design to give "Some parent node that is close to this macro call" (cf. https://doc.rust-lang.org/nightly/nightly-rustc/rustc_expand/base/struct.ExpansionData.html) meaning that allow on the same line as an attribute won't work. I'm note even sure if this would be possible.
    
    Found while working on rust-lang#94298.
    r? ``@petrochenkov``
    matthiaskrgr committed Mar 1, 2022
    Configuration menu
    Copy the full SHA
    05de9db View commit details
    Browse the repository at this point in the history
  14. Rollup merge of rust-lang#94476 - c410-f3r:yet-more-let-chains, r=Dyl…

    …an-DPC
    
    7 - Make more use of `let_chains`
    
    Continuation of rust-lang#94376.
    
    cc rust-lang#53667
    matthiaskrgr committed Mar 1, 2022
    Configuration menu
    Copy the full SHA
    e42ecc9 View commit details
    Browse the repository at this point in the history
  15. Rollup merge of rust-lang#94478 - GuillaumeGomez:macro-generated-intr…

    …a-doc-link, r=notriddle
    
    Fix panic when handling intra doc links generated from macro
    
    Fixes rust-lang#78591.
    Fixes rust-lang#92789.
    
    r? `@notriddle`
    matthiaskrgr committed Mar 1, 2022
    Configuration menu
    Copy the full SHA
    bf0dfaf View commit details
    Browse the repository at this point in the history
  16. Rollup merge of rust-lang#94482 - cuishuang:master, r=Dylan-DPC

    compiler: fix some typos
    matthiaskrgr committed Mar 1, 2022
    Configuration menu
    Copy the full SHA
    80bb09b View commit details
    Browse the repository at this point in the history
  17. Rollup merge of rust-lang#94490 - ehuss:update-books, r=ehuss

    Update books
    
    ## nomicon
    
    1 commits in 90993eeac93dbf9388992de92965f99cf6f29a03..f6d6126fc96ecf4a7f7d22da330df9506293b0d0
    2022-02-13 12:44:12 +0900 to 2022-02-26 02:21:21 +0900
    - ffi: explicitly declare hello_from_rust for C99 (rust-lang/nomicon#343)
    
    ## reference
    
    20 commits in 70fc73a6b908e08e66aa0306856c5211312f6c05..9d289c05fce7254b99c6a0d354d84abb7fd7a032
    2022-02-14 19:33:01 -0800 to 2022-02-23 08:58:20 -0800
    - Fix typo in `functions.md` (rust-lang/reference#1173)
    - Fix CI
    - Unify global_asm/asm directive list
    - Update src/inline-assembly.md
    - Update src/inline-assembly.md
    - Fix changes unintentional reverted in d5d3d80
    - Add note about operand interpolations
    - Sort lists, add syntax control directives
    - Add another missed batch suggestion
    - Add missed batch suggestion
    - Apply suggestions from code review
    - Add .type, .size, and .p2align
    - Reformat directive lists
    - Add `.inst` directive
    - Add missing directives
    - Add additional directives in use
    - Add `.fill` directive
    - Style fixes
    - Fix code block
    - Add supported Directives list
    
    ## book
    
    13 commits in 67b768c0b660a069a45f0e5d8ae2f679df1022ab..3f255ed40b8c82a0434088568fbed270dc31bf00
    2022-02-09 21:52:41 -0500 to 2022-02-27 21:26:12 -0500
    - Add a back reference about enum variant initializer fns. Fixes rust-lang/book#800.
    - Update ch01-03-hello-cargo.md
    - ch03-05: Add definite article for the block of code
    - Change variable names from "slice" to "values"
    - Remove reference to advanced lifetime section that no longer exists
    - Fix link to go to the right newtype section
    - Remove confusing and redundant part of a sentence about newtypes
    - Make transition less repetitive
    - Correct wording about associated functions.
    - Remove unnecessary extern crate proc_macro
    - Clarify that this code is defining, not using a procedural macro
    - Add manual regeneration steps for cargo new test
    - Update Listing 11-1 to reflect current contents
    
    ## rust-by-example
    
    11 commits in 18c0055b8aea49391e8f758a4400097999c9cf1e..2a928483a20bb306a7399c0468234db90d89afb5
    2022-01-19 08:51:55 -0300 to 2022-02-28 11:36:59 -0300
    - Update destructure_slice.md (rust-lang/rust-by-example#1513)
    - Update iter_find.md (rust-lang/rust-by-example#1512)
    - Add an example of collecting errors while iterating successes (rust-lang/rust-by-example#1509)
    - Fix broken link on asm (rust-lang/rust-by-example#1508)
    - Update abort_unwind.md (rust-lang/rust-by-example#1505)
    - Remove duplicate text in asm.md (rust-lang/rust-by-example#1506)
    - Improve asm clobber example (rust-lang/rust-by-example#1504)
    - Add +1 to next_age (rust-lang/rust-by-example#1503)
    - fix comment on into_iter() for arrays (rust-lang/rust-by-example#1502)
    - Added new Rust 1.58 direct format args (rust-lang/rust-by-example#1501)
    - documentation for cfg_panic (rust-lang/rust-by-example#1500)
    
    ## rustc-dev-guide
    
    13 commits in 62f58394ba7b203f55ac35ddcc4c0b79578f5706..32f2a5b4e7545318846185198542230170dd8a42
    2022-02-11 08:42:50 -0500 to 2022-03-01 10:45:24 -0600
    - Add architecture suggestion for Apple silicon (rust-lang/rustc-dev-guide#1320)
    - cargo timings has been stabilized (rust-lang/rustc-dev-guide#1319)
    - Add known-bug header. (rust-lang/rustc-dev-guide#1311)
    - Fix typo (rust-lang/rustc-dev-guide#1315)
    - Typo (rust-lang/rustc-dev-guide#1313)
    - instrument-coverage has been stabilized.
    - symbol-mangling-version has been stabilized
    - Fix `Ty` link (rust-lang/rustc-dev-guide#1308)
    - Edit glossary (rust-lang/rustc-dev-guide#1302)
    - Fix heading levels in the query chapter (rust-lang/rustc-dev-guide#1305)
    - Fix link
    - Edit "Queries" chapter (rust-lang/rustc-dev-guide#1301)
    - Link to The Rust Performance Book (rust-lang/rustc-dev-guide#1300)
    
    ## edition-guide
    
    1 commits in beea0a3cdc3885375342fd010f9ad658e6a5e09a..c55611dd6c58bdeb52423b5c52fd0f3c93615ba8
    2021-12-05 07:06:45 -0800 to 2022-02-21 14:21:39 +0100
    - Remove `+nightly` for `cargo new` (rust-lang/edition-guide#276)
    matthiaskrgr committed Mar 1, 2022
    Configuration menu
    Copy the full SHA
    ac04794 View commit details
    Browse the repository at this point in the history