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 9 pull requests #101052

Closed
wants to merge 45 commits into from
Closed

Commits on Jul 13, 2022

  1. Add a File::create_new constructor

    We have `File::create` for creating a file or opening an existing file,
    but the secure way to guarantee creating a new file requires a longhand
    invocation via `OpenOptions`.
    
    Add `File::create_new` to handle this case, to make it easier for people
    to do secure file creation.
    joshtriplett committed Jul 13, 2022
    Configuration menu
    Copy the full SHA
    e540425 View commit details
    Browse the repository at this point in the history

Commits on Aug 14, 2022

  1. Start uplifting clippy::for_loops_over_fallibles

    I refactored the code:
    - Removed handling of methods, as it felt entirely unnecessary
    - Removed clippy utils (obviously...)
    - Used some shiny compiler features
      (let-else is very handy for lints 👀)
    - I also renamed the lint to `for_loop_over_fallibles` (note: no `s`).
      I'm not sure what's the naming convention here, so maybe I'm wrong.
    WaffleLapkin committed Aug 14, 2022
    Configuration menu
    Copy the full SHA
    7b4cd17 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    810cf60 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    b661157 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    7cf94ad View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    14b8f24 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    2bf213b View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    5128140 View commit details
    Browse the repository at this point in the history
  8. for_loop_over_fallibles: fix suggestion for "remove .next()" case

    if the iterator is used after the loop, we need to use `.by_ref()`
    WaffleLapkin committed Aug 14, 2022
    Configuration menu
    Copy the full SHA
    34815a9 View commit details
    Browse the repository at this point in the history
  9. for_loop_over_fallibles: don't use MachineApplicable

    The loop could contain `break;` that won't work with an `if let`
    WaffleLapkin committed Aug 14, 2022
    Configuration menu
    Copy the full SHA
    c4ab59e View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    41fccb1 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    86360f4 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    d7b8a65 View commit details
    Browse the repository at this point in the history

Commits on Aug 15, 2022

  1. remove an infinite loop

    WaffleLapkin committed Aug 15, 2022
    Configuration menu
    Copy the full SHA
    aed1ae4 View commit details
    Browse the repository at this point in the history

Commits on Aug 18, 2022

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

Commits on Aug 22, 2022

  1. Configuration menu
    Copy the full SHA
    73ae38b View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    0043d10 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    1382d30 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    d75fd91 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    5164966 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    e701c72 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    9472df1 View commit details
    Browse the repository at this point in the history
  8. Resolve conflicts

    JeanCASPAR committed Aug 22, 2022
    Configuration menu
    Copy the full SHA
    5fef1b8 View commit details
    Browse the repository at this point in the history

Commits on Aug 23, 2022

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

Commits on Aug 24, 2022

  1. Configuration menu
    Copy the full SHA
    36c42fa View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    63700a8 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    89c74e8 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    d61ecec View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    4e97626 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    4ff5872 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    d464d3a View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    8189a45 View commit details
    Browse the repository at this point in the history

Commits on Aug 25, 2022

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

Commits on Aug 26, 2022

  1. diag-mig

    AndyJado committed Aug 26, 2022
    Configuration menu
    Copy the full SHA
    622217d View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    8bb4b5f View commit details
    Browse the repository at this point in the history
  3. rustdoc: remove incorrect CSS selector .impl-items table td

    Fixes rust-lang#100994
    
    This selector was added in c7312fb.
    The bug can be seen at <https://doc.rust-lang.org/1.27.0/alloc/slice/trait.SliceIndex.html#foreign-impls>.
    
    This rule was added to help with a `<table>` that was used for displaying the
    function signature [src] lockup. That lockup was changed in
    34bd2b8 to use flexbox instead, leaving this
    selector unused (at least, for its original purpose).
    notriddle committed Aug 26, 2022
    Configuration menu
    Copy the full SHA
    25eb52f View commit details
    Browse the repository at this point in the history
  4. Rollup merge of rust-lang#94890 - marmeladema:ip-addr-try-from-bytes,…

    … r=joshtriplett
    
    Support parsing IP addresses from a byte string
    
    Fixes rust-lang#94821
    
    The goal is to be able to parse addresses from a byte string without requiring to do any utf8 validation. Since internally the parser already works on byte strings, this should be possible and I personally already needed this in the past too.
    
    ~~I used the proposed approach from the issue by implementing `TryFrom<&'a [u8]>` for all 6 address types (3 ip address types and 3 socket address types). I believe implementing stable traits for stable types is insta-stable so this will probably need an FCP?~~
    
    Switched to an unstable inherent method approach called `parse_ascii` as requested.
    
    cc `@jyn514`
    Dylan-DPC authored Aug 26, 2022
    Configuration menu
    Copy the full SHA
    f9e4b15 View commit details
    Browse the repository at this point in the history
  5. Rollup merge of rust-lang#98801 - joshtriplett:file-create-new, r=thomcc

    Add a `File::create_new` constructor
    
    We have `File::create` for creating a file or opening an existing file,
    but the secure way to guarantee creating a new file requires a longhand
    invocation via `OpenOptions`.
    
    Add `File::create_new` to handle this case, to make it easier for people
    to do secure file creation.
    Dylan-DPC authored Aug 26, 2022
    Configuration menu
    Copy the full SHA
    1b2eef6 View commit details
    Browse the repository at this point in the history
  6. Rollup merge of rust-lang#99696 - WaffleLapkin:uplift, r=fee1-dead

    Uplift `clippy::for_loops_over_fallibles` lint into rustc
    
    This PR, as the title suggests, uplifts [`clippy::for_loops_over_fallibles`] lint into rustc. This lint warns for code like this:
    ```rust
    for _ in Some(1) {}
    for _ in Ok::<_, ()>(1) {}
    ```
    i.e. directly iterating over `Option` and `Result` using `for` loop.
    
    There are a number of suggestions that this PR adds (on top of what clippy suggested):
    1. If the argument (? is there a better name for that expression) of a `for` loop is a `.next()` call, then we can suggest removing it (or rather replacing with `.by_ref()` to allow iterator being used later)
       ```rust
        for _ in iter.next() {}
        // turns into
        for _ in iter.by_ref() {}
        ```
    2. (otherwise) We can suggest using `while let`, this is useful for non-iterator, iterator-like things like [async] channels
       ```rust
       for _ in rx.recv() {}
       // turns into
       while let Some(_) = rx.recv() {}
       ```
    3. If the argument type is `Result<impl IntoIterator, _>` and the body has a `Result<_, _>` type, we can suggest using `?`
       ```rust
       for _ in f() {}
       // turns into
       for _ in f()? {}
       ```
    4. To preserve the original behavior and clear intent, we can suggest using `if let`
       ```rust
       for _ in f() {}
       // turns into
       if let Some(_) = f() {}
       ```
    (P.S. `Some` and `Ok` are interchangeable depending on the type)
    
    I still feel that the lint wording/look is somewhat off, so I'll be happy to hear suggestions (on how to improve suggestions :D)!
    
    Resolves rust-lang#99272
    
    [`clippy::for_loops_over_fallibles`]: https://rust-lang.github.io/rust-clippy/master/index.html#for_loops_over_fallibles
    Dylan-DPC authored Aug 26, 2022
    Configuration menu
    Copy the full SHA
    e24cc6a View commit details
    Browse the repository at this point in the history
  7. Rollup merge of rust-lang#100437 - compiler-errors:better-const-misma…

    …tch-err, r=oli-obk
    
    Improve const mismatch `FulfillmentError`
    
    Fixes rust-lang#100414
    Dylan-DPC authored Aug 26, 2022
    Configuration menu
    Copy the full SHA
    30b301d View commit details
    Browse the repository at this point in the history
  8. Rollup merge of rust-lang#100640 - reitermarkus:socket-display-buffer…

    …, r=thomcc
    
    Use `DisplayBuffer` for socket addresses.
    
    Continuation of rust-lang#100625 for socket addresses.
    
    Renames `net::addr` to `net::addr::socket`, `net::ip` to `net::addr::ip` and `net::ip::display_buffer::IpDisplayBuffer` to `net::addr::display_buffer::DisplayBuffer`.
    Dylan-DPC authored Aug 26, 2022
    Configuration menu
    Copy the full SHA
    e232605 View commit details
    Browse the repository at this point in the history
  9. Rollup merge of rust-lang#100724 - JeanCASPAR:migrate-ast_lowering-to…

    …-session-diagnostic, r=davidtwco
    
    Migrate ast lowering to session diagnostic
    
    I migrated the whole rustc_ast_lowering crate to session diagnostic *except* the for the use of `span_fatal` at /compiler/rustc_ast_lowering/src/expr.rs#L1268 because `#[fatal(...)]` is not yet supported (see rust-lang#100694).
    Dylan-DPC authored Aug 26, 2022
    Configuration menu
    Copy the full SHA
    a0b8f22 View commit details
    Browse the repository at this point in the history
  10. Rollup merge of rust-lang#100897 - RalfJung:const-not-to-mutable, r=lcnr

    extra sanity check against consts pointing to mutable memory
    
    This should be both unreachable and redundant (since we already ensure that validation only reads from read-only memory, when validating consts), but I feel like we cannot be paranoid enough here, and also if this ever fails it'll be a nicer error than the "cannot read from mutable memory" error.
    Dylan-DPC authored Aug 26, 2022
    Configuration menu
    Copy the full SHA
    63519c5 View commit details
    Browse the repository at this point in the history
  11. Rollup merge of rust-lang#100900 - AndyJado:diag-migrate, r=davidtwco

    on `region_errors.rs`
    
    `@rustbot` label +A-translation
    Dylan-DPC authored Aug 26, 2022
    Configuration menu
    Copy the full SHA
    5fea6a0 View commit details
    Browse the repository at this point in the history
  12. Rollup merge of rust-lang#101046 - notriddle:notriddle/table-css, r=jsha

    rustdoc: remove incorrect CSS selector `.impl-items table td`
    
    Fixes rust-lang#100994
    
    This selector was added in c7312fb. The bug can be seen at <https://doc.rust-lang.org/1.27.0/alloc/slice/trait.SliceIndex.html#foreign-impls>.
    
    This rule was added to help with a `<table>` that was used for displaying the function signature [src] lockup. That lockup was changed in 34bd2b8 to use flexbox instead, leaving this selector unused (at least, for its original purpose).
    Dylan-DPC authored Aug 26, 2022
    Configuration menu
    Copy the full SHA
    d4bd059 View commit details
    Browse the repository at this point in the history