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 6 pull requests #133259

Closed
wants to merge 23 commits into from

Commits on Sep 24, 2024

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

Commits on Oct 10, 2024

  1. uefi: process: Add args support

    - Wrap all args with quotes.
    - Escape ^ and " inside quotes using ^.
    
    Signed-off-by: Ayush Singh <[email protected]>
    Ayush1325 committed Oct 10, 2024
    Configuration menu
    Copy the full SHA
    3727a8c View commit details
    Browse the repository at this point in the history

Commits on Oct 27, 2024

  1. Configuration menu
    Copy the full SHA
    1709a85 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ba12a99 View commit details
    Browse the repository at this point in the history

Commits on Nov 17, 2024

  1. Point at const definition when used instead of a binding in a let

    … statement
    
    After:
    
    ```
    error[E0005]: refutable pattern in local binding
      --> $DIR/bad-pattern.rs:19:13
       |
    LL |     const PAT: u32 = 0;
       |     -------------- missing patterns are not covered because `PAT` is interpreted as a constant pattern, not a new variable
    ...
    LL |         let PAT = v1;
       |             ^^^
       |             |
       |             pattern `1_u32..=u32::MAX` not covered
       |             help: introduce a variable instead: `PAT_var`
       |
       = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
       = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
       = note: the matched value is of type `u32`
    ```
    
    Before:
    
    ```
    error[E0005]: refutable pattern in local binding
      --> $DIR/bad-pattern.rs:19:13
       |
    LL |         let PAT = v1;
       |             ^^^
       |             |
       |             pattern `1_u32..=u32::MAX` not covered
       |             missing patterns are not covered because `PAT` is interpreted as a constant pattern, not a new variable
       |             help: introduce a variable instead: `PAT_var`
       |
       = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
       = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
       = note: the matched value is of type `u32`
    ```
    estebank committed Nov 17, 2024
    Configuration menu
    Copy the full SHA
    ff2f7a7 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    c25b44b View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    6dc79f6 View commit details
    Browse the repository at this point in the history
  4. Point at const when intended binding fall-through pattern is a const

    ```
    error[E0004]: non-exhaustive patterns: `i32::MIN..=3_i32` and `5_i32..=i32::MAX` not covered
      --> $DIR/intended-binding-pattern-is-const.rs:2:11
       |
    LL |     match 1 {
       |           ^ patterns `i32::MIN..=3_i32` and `5_i32..=i32::MAX` not covered
    LL |         x => {}
       |         - this pattern doesn't introduce a new catch-all binding, but rather pattern matches against the value of constant `x`
       |
       = note: the matched value is of type `i32`
    note: constant `x` defined here
      --> $DIR/intended-binding-pattern-is-const.rs:7:5
       |
    LL |     const x: i32 = 4;
       |     ^^^^^^^^^^^^
    help: if you meant to introduce a binding, use a different name
       |
    LL |         x_var => {}
       |          ++++
    help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern, a match arm with multiple or-patterns as shown, or multiple match arms
       |
    LL |         x => {}, i32::MIN..=3_i32 | 5_i32..=i32::MAX => todo!()
       |                ++++++++++++++++++++++++++++++++++++++++++++++++
    ```
    estebank committed Nov 17, 2024
    Configuration menu
    Copy the full SHA
    a5b4d45 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    f563efe View commit details
    Browse the repository at this point in the history
  6. Make suggestion verbose

    estebank committed Nov 17, 2024
    Configuration menu
    Copy the full SHA
    f1772d5 View commit details
    Browse the repository at this point in the history
  7. review comments

    estebank committed Nov 17, 2024
    Configuration menu
    Copy the full SHA
    bb37e5d View commit details
    Browse the repository at this point in the history
  8. review comments

    - Remove check for "how many path segments is the pattern"
    - Check before suggesting if the path has multiple path segments
    estebank committed Nov 17, 2024
    Configuration menu
    Copy the full SHA
    6480b76 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    912ee65 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    29acf8b View commit details
    Browse the repository at this point in the history

Commits on Nov 20, 2024

  1. Configuration menu
    Copy the full SHA
    f37d021 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    06e66d7 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    228068b View commit details
    Browse the repository at this point in the history
  4. Rollup merge of rust-lang#129838 - Ayush1325:uefi-process-args, r=joboet

    uefi: process: Add args support
    
    - Wrap all args with quotes.
    - Escape ^ and " inside quotes using ^.
    - Doing reverse of arg parsing: https://github.com/rust-lang/rust/blob/d571ae851d93541bef826c3c48c1e9ad99da77d6/library/std/src/sys/pal/uefi/args.rs#L81
    
     r​? joboet
    matthiaskrgr authored Nov 20, 2024
    Configuration menu
    Copy the full SHA
    8a8069a View commit details
    Browse the repository at this point in the history
  5. Rollup merge of rust-lang#130800 - bjoernager:const-mut-cursor, r=jos…

    …htriplett
    
    Mark `get_mut` and `set_position` in `std::io::Cursor` as const.
    
    Relevant tracking issue: rust-lang#130801
    
    The methods `get_mut` and `set_position` can trivially be marked as const due to rust-lang#57349 being stabilised.
    matthiaskrgr authored Nov 20, 2024
    Configuration menu
    Copy the full SHA
    ce1543f View commit details
    Browse the repository at this point in the history
  6. Rollup merge of rust-lang#132207 - compiler-errors:tweak-res-mod-segm…

    …ent, r=petrochenkov
    
    Store resolution for self and crate root module segments
    
    Let's make sure to record the segment resolution for `self::`, `crate::` and `$crate::`.
    
    I'm actually somewhat surprised that the only diagnostic that uses this is the one that errors on invalid generics on a module segment... but seems strictly more correct regardless, and there may be other diagnostics using these segments resolutions that just haven't been tested for `self`. Also includes a drive-by on `report_prohibit_generics_error`.
    matthiaskrgr authored Nov 20, 2024
    Configuration menu
    Copy the full SHA
    edf0995 View commit details
    Browse the repository at this point in the history
  7. Rollup merge of rust-lang#132708 - estebank:const-as-binding, r=Nadri…

    …eril
    
    Point at `const` definition when used instead of a binding in a `let` statement
    
    Modify `PatKind::InlineConstant` to be `ExpandedConstant` standing in not only for inline `const` blocks but also for `const` items. This allows us to track named `const`s used in patterns when the pattern is a single binding. When we detect that there is a refutable pattern involving a `const` that could have been a binding instead, we point at the `const` item, and suggest renaming. We do this for both `let` bindings and `match` expressions missing a catch-all arm if there's at least one single binding pattern referenced.
    
    After:
    
    ```
    error[E0005]: refutable pattern in local binding
      --> $DIR/bad-pattern.rs:19:13
       |
    LL |     const PAT: u32 = 0;
       |     -------------- missing patterns are not covered because `PAT` is interpreted as a constant pattern, not a new variable
    ...
    LL |         let PAT = v1;
       |             ^^^ pattern `1_u32..=u32::MAX` not covered
       |
       = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
       = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
       = note: the matched value is of type `u32`
    help: introduce a variable instead
       |
    LL |         let PAT_var = v1;
       |             ~~~~~~~
    ```
    
    Before:
    
    ```
    error[E0005]: refutable pattern in local binding
      --> $DIR/bad-pattern.rs:19:13
       |
    LL |         let PAT = v1;
       |             ^^^
       |             |
       |             pattern `1_u32..=u32::MAX` not covered
       |             missing patterns are not covered because `PAT` is interpreted as a constant pattern, not a new variable
       |             help: introduce a variable instead: `PAT_var`
       |
       = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
       = note: for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
       = note: the matched value is of type `u32`
    ```
    
    CC rust-lang#132582.
    matthiaskrgr authored Nov 20, 2024
    Configuration menu
    Copy the full SHA
    4f53fa2 View commit details
    Browse the repository at this point in the history
  8. Rollup merge of rust-lang#133226 - compiler-errors:opt-in-pointer-lik…

    …e, r=lcnr
    
    Make `PointerLike` opt-in instead of built-in
    
    The `PointerLike` trait currently is a built-in trait that computes the layout of the type. This is a bit problematic, because types implement this trait automatically. Since this can be broken due to semver-compatible changes to a type's layout, this is undesirable. Also, calling `layout_of` in the trait system also causes cycles.
    
    This PR makes the trait implemented via regular impls, and adds additional validation on top to make sure that those impls are valid. This could eventually be `derive()`d for custom smart pointers, and we can trust *that* as a semver promise rather than risking library authors accidentally breaking it.
    
    On the other hand, we may never expose `PointerLike`, but at least now the implementation doesn't invoke `layout_of` which could cause ICEs or cause cycles.
    
    Right now for a `PointerLike` impl to be valid, it must be an ADT that is `repr(transparent)` and the non-1zst field needs to implement `PointerLike`. There are also some primitive impls for `&T`/ `&mut T`/`*const T`/`*mut T`/`Box<T>`.
    matthiaskrgr authored Nov 20, 2024
    Configuration menu
    Copy the full SHA
    eb9fbb0 View commit details
    Browse the repository at this point in the history
  9. Rollup merge of rust-lang#133244 - daxpedda:wasm32v1-none-atomic, r=a…

    …lexcrichton
    
    Account for `wasm32v1-none` when exporting TLS symbols
    
    Exporting TLS related symbols was limited to `wasm32-unknown-unknown` because WASI and Emscripten (?) have their own infrastructure to deal with TLS. However, the introduction of `wasm32v1-none` is in the same boat as `wasm32-unknown-unknown`.
    
    This PR adjust the mechanism to account for `wasm32v1-none` as well.
    
    See rust-lang#102385 and rust-lang#102440.
    
    r? `@alexcrichton`
    matthiaskrgr authored Nov 20, 2024
    Configuration menu
    Copy the full SHA
    6199e01 View commit details
    Browse the repository at this point in the history