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 #128186

Merged
merged 17 commits into from
Jul 25, 2024
Merged

Rollup of 7 pull requests #128186

merged 17 commits into from
Jul 25, 2024

Commits on Jul 10, 2024

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

Commits on Jul 24, 2024

  1. Configuration menu
    Copy the full SHA
    c31ff97 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    4b7a87d View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    2c7ae38 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    c9cd4a6 View commit details
    Browse the repository at this point in the history

Commits on Jul 25, 2024

  1. Configuration menu
    Copy the full SHA
    40d132f View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    d004edf View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    34819b7 View commit details
    Browse the repository at this point in the history
  4. In connect timeout, read readiness of socket for vxworks. Check pollh…

    …up or pollerr for refused connections in linux
    B I Mohammed Abbas committed Jul 25, 2024
    Configuration menu
    Copy the full SHA
    17b4fbc View commit details
    Browse the repository at this point in the history
  5. Rollup merge of rust-lang#121364 - Urgau:unary_precedence, r=compiler…

    …-errors
    
    Implement lint against ambiguous negative literals
    
    This PR implements a lint against ambiguous negative literals with a literal and method calls right after it.
    
    ## `ambiguous_negative_literals`
    
    (deny-by-default)
    
    The `ambiguous_negative_literals` lint checks for cases that are confusing between a negative literal and a negation that's not part of the literal.
    
    ### Example
    
    ```rust,compile_fail
    -1i32.abs(); // equals -1, while `(-1i32).abs()` equals 1
    ```
    
    ### Explanation
    
    Method calls take precedence over unary precedence. Setting the precedence explicitly makes the code clearer and avoid potential bugs.
    
    <details>
    <summary>Old proposed lint</summary>
    
    ## `ambiguous_unary_precedence`
    
    (deny-by-default)
    
    The `ambiguous_unary_precedence` lint checks for use the negative unary operator with a literal and method calls.
    
    ### Example
    
    ```rust
    -1i32.abs(); // equals -1, while `(-1i32).abs()` equals 1
    ```
    
    ### Explanation
    
    Unary operations take precedence on binary operations and method calls take precedence over unary precedence. Setting the precedence explicitly makes the code clearer and avoid potential bugs.
    
    </details>
    
    -----
    
    Note: This is a strip down version of rust-lang#117161, without the binary op precedence.
    
    Fixes rust-lang#117155
    `@rustbot` labels +I-lang-nominated
    cc `@scottmcm`
    r? compiler
    matthiaskrgr authored Jul 25, 2024
    Configuration menu
    Copy the full SHA
    ae71900 View commit details
    Browse the repository at this point in the history
  6. Rollup merge of rust-lang#127300 - biabbas:fix_connect_timeout, r=tgr…

    …oss35
    
    Fix connect timeout for non-linux targets, read readiness of socket connection, Read readiness to detect errors. `Fixes rust-lang#127018`
    
    Fixes rust-lang#127018
    Connect_timeout would call `poll` and check `pollfd.revents` for POLLHUP error, rather that checking readiness. This behavior was meant for Linux as it returns POLLHUP | POLLOUT | POLLERR in case of errors. But on targets that do not return POLLHUP in `pollfd.revents`, this would indicate a false success and result in this issue. To resolve this we will check readiness of socket using  `getsockopt():`  and return success from connect_timeout when there are no errors.
    Changes were tested on Linux and an rtos.
    ![Screenshot 2024-07-04 105820](https://github.com/rust-lang/rust/assets/88673422/5ef5a87f-f2af-4fb7-98da-7612d5e27e9a)
    Thank you.
    matthiaskrgr authored Jul 25, 2024
    Configuration menu
    Copy the full SHA
    d1070df View commit details
    Browse the repository at this point in the history
  7. Rollup merge of rust-lang#128138 - folkertdev:asm-option-allowlist, r…

    …=lcnr
    
    `#[naked]`: use an allowlist for allowed options on `asm!` in naked functions
    
    tracking issue: rust-lang#90957
    
    this is mostly just a refactor, but using an allowlist (rather than a denylist) for which asm options are allowed in naked functions is a little safer.
    
    These options are disallowed because naked functions are effectively global asm, but defined using inline asm.
    matthiaskrgr authored Jul 25, 2024
    Configuration menu
    Copy the full SHA
    e76bb3f View commit details
    Browse the repository at this point in the history
  8. Rollup merge of rust-lang#128158 - workingjubilee:unsafe-wrap-persona…

    …lity-gcc, r=ChrisDenton
    
    std: unsafe-wrap personality::gcc
    
    Nothing seems obviously wrong with these implementations except for some unanswered questions. Admittedly, I don't want to burn excessive time on exceptional exception handlers. Thus this is mostly a brute-force syntactic wrapping and some comments where they seemed correct, creating another largely whitespace diff.
    
    try-job: armhf-gnu
    matthiaskrgr authored Jul 25, 2024
    Configuration menu
    Copy the full SHA
    606c9fc View commit details
    Browse the repository at this point in the history
  9. Rollup merge of rust-lang#128171 - compiler-errors:arg-compat, r=oli-obk

    Make sure that args are compatible in `resolve_associated_item`
    
    Implements a similar check to the one that we have in projection for GATs (rust-lang#102488, rust-lang#123240), where we check that the args of an impl item are compatible before returning it. This is done in `resolve_assoc_item`, which is backing `Instance::resolve`, so this is conceptually generalizing the check from GATs to methods/assoc consts. This is important to make sure that the inliner will only visit and substitute MIR bodies that are compatible w/ their trait definitions.
    
    This shouldn't happen in codegen, but there are a few ways to get the inliner to be invoked (via calls to `optimized_mir`) before codegen, namely polymorphization and CTFE.
    
    Fixes rust-lang#121957
    Fixes rust-lang#120792
    Fixes rust-lang#120793
    Fixes rust-lang#121063
    matthiaskrgr authored Jul 25, 2024
    Configuration menu
    Copy the full SHA
    5a853d0 View commit details
    Browse the repository at this point in the history
  10. Rollup merge of rust-lang#128172 - compiler-errors:non-self-arg, r=ch…

    …enyukang
    
    Don't ICE if HIR and middle types disagree in borrowck error reporting
    
    We try to match up the `middle::ty::Ty` and `hir::Ty` types in borrowck error reporting, but due to things like `Self` self type alias, or regular type aliases, these might not match up. Don't ICE.
    
    This PR also tries to recover the error by looking up the self type of the impl in case we see `Self`. The diagnostic is frankly quite confusing, but I also didn't really want to look at it because I don't understand the conflict error reporting logic. 🤷
    
    Fixes rust-lang#121816
    matthiaskrgr authored Jul 25, 2024
    Configuration menu
    Copy the full SHA
    4cf4196 View commit details
    Browse the repository at this point in the history
  11. Rollup merge of rust-lang#128173 - compiler-errors:misused-intrinsics…

    …, r=oli-obk
    
    Remove crashes for misuses of intrinsics
    
    All of these do not crash if the feature gate is removed. An ICE due *opting into* the intrinsics feature gate is not a bug that needs to be fixed, but instead a misuse of an internal-only API.
    
    See rust-lang/compiler-team#620
    
    The last two issues are already closed anyways, but:
    Fixes rust-lang#97501
    Fixes rust-lang#111699
    Fixes rust-lang#101962
    matthiaskrgr authored Jul 25, 2024
    Configuration menu
    Copy the full SHA
    c98d704 View commit details
    Browse the repository at this point in the history