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 5 pull requests #128423

Closed
wants to merge 23 commits into from

Commits on Jul 29, 2024

  1. Structured suggestion for extern crate foo when foo isn't resolve…

    …d in import
    
    When encountering a name in an import that could have come from a crate that wasn't imported, use a structured suggestion to suggest `extern crate foo;` pointing at the right place in the crate.
    
    When encountering `_` in an import, do not suggest `extern crate _;`.
    
    ```
    error[E0432]: unresolved import `spam`
      --> $DIR/import-from-missing-star-3.rs:2:9
       |
    LL |     use spam::*;
       |         ^^^^ maybe a missing crate `spam`?
       |
    help: consider importing the `spam` crate
       |
    LL + extern crate spam;
       |
    ```
    estebank committed Jul 29, 2024
    Configuration menu
    Copy the full SHA
    b61570a View commit details
    Browse the repository at this point in the history

Commits on Jul 30, 2024

  1. Attribute checking simplifications

    remove an unused boolean and then merge two big matches into one
    oli-obk committed Jul 30, 2024
    Configuration menu
    Copy the full SHA
    67a08b5 View commit details
    Browse the repository at this point in the history
  2. Revert "Rollup merge of rust-lang#128104 - mu001999-contrib:fix/12805…

    …3, r=petrochenkov"
    
    This reverts commit 91b18a0, reversing
    changes made to 9aedec9.
    compiler-errors committed Jul 30, 2024
    Configuration menu
    Copy the full SHA
    efdf219 View commit details
    Browse the repository at this point in the history
  3. Revert "Rollup merge of rust-lang#127017 - mu001999-contrib:dead/enha…

    …nce, r=pnkfelix"
    
    This reverts commit a70dc29, reversing
    changes made to ceae371.
    compiler-errors committed Jul 30, 2024
    Configuration menu
    Copy the full SHA
    8a0cd61 View commit details
    Browse the repository at this point in the history
  4. Revert "Rollup merge of rust-lang#127107 - mu001999-contrib:dead/enha…

    …nce-2, r=pnkfelix"
    
    This reverts commit 31fe962, reversing
    changes made to f203078.
    compiler-errors committed Jul 30, 2024
    Configuration menu
    Copy the full SHA
    cfe4039 View commit details
    Browse the repository at this point in the history
  5. Revert "Rollup merge of rust-lang#126618 - mu001999-contrib:dead/enha…

    …nce, r=pnkfelix"
    
    This reverts commit 2724aea, reversing
    changes made to d929a42.
    compiler-errors committed Jul 30, 2024
    Configuration menu
    Copy the full SHA
    16d989b View commit details
    Browse the repository at this point in the history
  6. Revert "Rollup merge of rust-lang#126315 - mu001999-contrib:fix/12628…

    …9, r=petrochenkov"
    
    This reverts commit 977c5fd, reversing
    changes made to 24c94f0.
    compiler-errors committed Jul 30, 2024
    Configuration menu
    Copy the full SHA
    3037f88 View commit details
    Browse the repository at this point in the history
  7. Revert "Rollup merge of rust-lang#125572 - mu001999-contrib:dead/enha…

    …nce, r=pnkfelix"
    
    This reverts commit 13314df, reversing
    changes made to 6e534c7.
    compiler-errors committed Jul 30, 2024
    Configuration menu
    Copy the full SHA
    ada5b54 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    4e84989 View commit details
    Browse the repository at this point in the history
  9. Bless test fallout

    compiler-errors committed Jul 30, 2024
    Configuration menu
    Copy the full SHA
    72844ee View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    a75d2f9 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    9169622 View commit details
    Browse the repository at this point in the history
  12. Specify the integer type of the powi LLVM intrinsic

    Since LLVM <https://reviews.llvm.org/D99439> (4c7f820, "Update
    @llvm.powi to handle different int sizes for the exponent"), the size of
    the integer can be specified for the `powi` intrinsic. Make use of this
    so it is more obvious that integer size is consistent across all float
    types.
    
    This feature is available since LLVM 13 (October 2021). Based on
    bootstrap we currently support >= 17.0, so there should be no support
    problems.
    tgross35 committed Jul 30, 2024
    Configuration menu
    Copy the full SHA
    c586eb6 View commit details
    Browse the repository at this point in the history
  13. Add math intrinsics for f16 and f128

    These already exist in the compiler. Expose them in core so we can add
    their library functions.
    tgross35 committed Jul 30, 2024
    Configuration menu
    Copy the full SHA
    b6d0517 View commit details
    Browse the repository at this point in the history
  14. Add math functions for f16 and f128

    This adds missing functions for math operations on the new float types.
    
    Platform support is pretty spotty at this point, since even platforms
    with generally good support can be missing math functions.
    `std/build.rs` is updated to reflect this.
    tgross35 committed Jul 30, 2024
    Configuration menu
    Copy the full SHA
    90e63dd View commit details
    Browse the repository at this point in the history
  15. Add core functions for f16 and f128 that require math routines

    `min`, `max`, and similar functions require external math routines. Add
    these under the same gates as `std` math functions (`reliable_f16_math`
    and `reliable_f128_math`).
    tgross35 committed Jul 30, 2024
    Configuration menu
    Copy the full SHA
    a4657dd View commit details
    Browse the repository at this point in the history
  16. Update comments for {f16, f32, f64, f128}::midpoint

    Clarify what makes some operations not safe, and correct comment in the
    default branch ("not safe" -> "safe").
    tgross35 committed Jul 30, 2024
    Configuration menu
    Copy the full SHA
    e1d23c9 View commit details
    Browse the repository at this point in the history
  17. Add a disclaimer about x86 f128 math functions

    Due to a LLVM bug, `f128` math functions link successfully but LLVM
    chooses the wrong symbols (`long double` symbols rather than those for
    binary128).
    
    Since this is a notable problem that may surprise a number of users, add
    a note about it.
    
    Link: llvm/llvm-project#44744
    tgross35 committed Jul 30, 2024
    Configuration menu
    Copy the full SHA
    d64bbb1 View commit details
    Browse the repository at this point in the history

Commits on Jul 31, 2024

  1. Rollup merge of rust-lang#128151 - estebank:missing-extern-crate, r=p…

    …etrochenkov
    
    Structured suggestion for `extern crate foo` when `foo` isn't resolved in import
    
    When encountering a name in an import that could have come from a crate that wasn't imported, use a structured suggestion to suggest `extern crate foo;` pointing at the right place in the crate.
    
    When encountering `_` in an import, do not suggest `extern crate _;`.
    
    ```
    error[E0432]: unresolved import `spam`
      --> $DIR/import-from-missing-star-3.rs:2:9
       |
    LL |     use spam::*;
       |         ^^^^ maybe a missing crate `spam`?
       |
    help: consider importing the `spam` crate
       |
    LL + extern crate spam;
       |
    ```
    matthiaskrgr authored Jul 31, 2024
    Configuration menu
    Copy the full SHA
    144a1bf View commit details
    Browse the repository at this point in the history
  2. Rollup merge of rust-lang#128162 - ChrisDenton:cleanup, r=joboet

    Cleanup sys module to match house style
    
    This moves a test file out of sys as it's just testing std types. Also cleans up some assorted bits including making the `use` statements match the house style.
    matthiaskrgr authored Jul 31, 2024
    Configuration menu
    Copy the full SHA
    a9ed873 View commit details
    Browse the repository at this point in the history
  3. Rollup merge of rust-lang#128402 - oli-obk:checked_attrs, r=compiler-…

    …errors
    
    Attribute checking simplifications
    
    remove an unused boolean and then merge two big matches into one
    
    I was reviewing some attributes and realized we don't really check this list against the list of builtin attributes, so we "may" totally be missing some attributes that we should be checking (like the `coroutine` attribute, which you can just apply to random stuff)
    
    ```rust
    #![feature(coroutines)]
    #[coroutine]
    struct Foo;
    ```
    
    just compiles for example. Unless we check that the fallthrough match arm is never reached for builtin attributes, we're just going to keep forgetting to add them here, too. I can do that without the changes in this PR, but it seemed like a nice cleanup
    matthiaskrgr authored Jul 31, 2024
    Configuration menu
    Copy the full SHA
    4940bb2 View commit details
    Browse the repository at this point in the history
  4. Rollup merge of rust-lang#128404 - compiler-errors:revert-dead-code-c…

    …hanges, r=pnkfelix
    
    Revert recent changes to dead code analysis
    
    This is a revert to recent changes to dead code analysis, namely:
    * efdf219 Rollup merge of rust-lang#128104 - mu001999-contrib:fix/128053, r=petrochenkov
    * a70dc29 Rollup merge of rust-lang#127017 - mu001999-contrib:dead/enhance, r=pnkfelix
    * 31fe962 Rollup merge of rust-lang#127107 - mu001999-contrib:dead/enhance-2, r=pnkfelix
    * 2724aea Rollup merge of rust-lang#126618 - mu001999-contrib:dead/enhance, r=pnkfelix
    * 977c5fd Rollup merge of rust-lang#126315 - mu001999-contrib:fix/126289, r=petrochenkov
    * 13314df Rollup merge of rust-lang#125572 - mu001999-contrib:dead/enhance, r=pnkfelix
    
    There is an additional change stacked on top, which suppresses false-negatives that were masked by this work. I believe the functions that are touched in that code are legitimately unused functions and the types are not reachable since this `AnonPipe` type is not publically reachable -- please correct me if I'm wrong cc `@NobodyXu` who added these in #rust-lang#127153.
    
    Some of these reverts (rust-lang#126315 and rust-lang#126618) are only included because it makes the revert apply cleanly, and I think these changes were only done to fix follow-ups from the other PRs?
    
    I apologize for the size of the PR and the churn that it has on the codebase (and for reverting `@mu001999's` work here), but I'm putting this PR up because I am concerned that we're making ad-hoc changes to fix bugs that are fallout of these PRs, and I'd like to see these changes reimplemented in a way that's more separable from the existing dead code pass. I am happy to review any code to reapply these changes in a more separable way.
    
    cc `@mu001999`
    r? `@pnkfelix`
    
    Fixes rust-lang#128272
    Fixes rust-lang#126169
    matthiaskrgr authored Jul 31, 2024
    Configuration menu
    Copy the full SHA
    0c986b1 View commit details
    Browse the repository at this point in the history
  5. Rollup merge of rust-lang#128417 - tgross35:f16-f128-math, r=dtolnay

    Add `f16` and `f128` math functions
    
    This adds intrinsics and math functions for `f16` and `f128` floating point types. Support is quite limited and some things are broken so tests don't run on many platforms, but this provides a starting point.
    matthiaskrgr authored Jul 31, 2024
    Configuration menu
    Copy the full SHA
    edc1983 View commit details
    Browse the repository at this point in the history