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

Closed
wants to merge 35 commits into from

Commits on Jul 25, 2024

  1. create a new section on pointer to reference conversion

    also start deduplicating the docs that are getting moved to this
    section.
    lolbinarycat committed Jul 25, 2024
    Configuration menu
    Copy the full SHA
    7643ea5 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    1073f97 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    3877a7b View commit details
    Browse the repository at this point in the history

Commits on Aug 15, 2024

  1. Add warn(unreachable_pub) to several crates.

    It requires no additonal changes to these crates, but will prevent
    unnecessary `pub`s in the future.
    nnethercote committed Aug 15, 2024
    Configuration menu
    Copy the full SHA
    1944894 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    f839309 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    ea014b4 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    a6b2880 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    f2fc87d View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    6614165 View commit details
    Browse the repository at this point in the history
  7. Don't add warn(unreachable_pub) to rustc_baked_icu.

    But explain why.
    nnethercote committed Aug 15, 2024
    Configuration menu
    Copy the full SHA
    cb3f435 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    0685c97 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    0544d3a View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    6162743 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    cc84442 View commit details
    Browse the repository at this point in the history

Commits on Aug 22, 2024

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

Commits on Aug 23, 2024

  1. document & impl the transmutation modeled by BikeshedIntrinsicFrom

    Documents that `BikeshedIntrinsicFrom` models transmute-via-union,
    which is slightly more expressive than the transmute-via-cast
    implemented by `transmute_copy`. Additionally, we provide an
    implementation of transmute-via-union as a method on the
    `BikeshedIntrinsicFrom` trait with additional documentation on
    the boundary between trait invariants and caller obligations.
    
    Whether or not transmute-via-union is the right kind of transmute
    to model remains up for discussion [1]. Regardless, it seems wise
    to document the present behavior.
    
    [1] https://rust-lang.zulipchat.com/#narrow/stream/216762-project-safe-transmute/topic/What.20'kind'.20of.20transmute.20to.20model.3F/near/426331967
    jswrenn committed Aug 23, 2024
    Configuration menu
    Copy the full SHA
    2540070 View commit details
    Browse the repository at this point in the history

Commits on Aug 25, 2024

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

Commits on Aug 26, 2024

  1. Improve isqrt tests and add benchmarks

    * Choose test inputs more thoroughly and systematically.
    * Check that `isqrt` and `checked_isqrt` have equivalent results for
      signed types, either equivalent numerically or equivalent as a panic
      and a `None`.
    * Check that `isqrt` has numerically-equivalent results for unsigned
      types and their `NonZero` counterparts.
    * Reuse `ilog10` benchmarks, plus benchmarks that use a uniform
      distribution.
    ChaiTRex committed Aug 26, 2024
    Configuration menu
    Copy the full SHA
    6cd9bcd View commit details
    Browse the repository at this point in the history
  2. Speed up checked_isqrt and isqrt methods

    * Use a lookup table for 8-bit integers and the Karatsuba square root
      algorithm for larger integers.
    * Include optimization hints that give the compiler the exact numeric
      range of results.
    ChaiTRex committed Aug 26, 2024
    Configuration menu
    Copy the full SHA
    e1d0630 View commit details
    Browse the repository at this point in the history
  3. Do not ICE on non-ADT rcvr type when looking for crate version collision

    When looking for multiple versions of the same crate, do not blindly construct the receiver type.
    
    Follow up to rust-lang#128786. Fix rust-lang#129205.
    estebank authored and compiler-errors committed Aug 26, 2024
    Configuration menu
    Copy the full SHA
    00c435d View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    4a088d9 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    b11e0a8 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    4e15554 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    b4d3fa4 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    2db1d2e View commit details
    Browse the repository at this point in the history
  9. Rollup merge of rust-lang#126013 - nnethercote:unreachable_pub, r=Urgau

    Add `#[warn(unreachable_pub)]` to a bunch of compiler crates
    
    By default `unreachable_pub` identifies things that need not be `pub` and tells you to make them `pub(crate)`. But sometimes those things don't need any kind of visibility. So they way I did these was to remove the visibility entirely for each thing the lint identifies, and then add `pub(crate)` back in everywhere the compiler said it was necessary. (Or occasionally `pub(super)` when context suggested that was appropriate.) Tedious, but results in more `pub` removal.
    
    There are plenty more crates to do but this seems like enough for a first PR.
    
    r? `@compiler-errors`
    matthiaskrgr authored Aug 26, 2024
    Configuration menu
    Copy the full SHA
    478987e View commit details
    Browse the repository at this point in the history
  10. Rollup merge of rust-lang#128157 - lolbinarycat:unify-ptr-ref-docs, r…

    …=cuviper
    
    deduplicate and clarify rules for converting pointers to references
    
    part of rust-lang#124669
    matthiaskrgr authored Aug 26, 2024
    Configuration menu
    Copy the full SHA
    71f406c View commit details
    Browse the repository at this point in the history
  11. Rollup merge of rust-lang#128166 - ChaiTRex:isqrt, r=tgross35

    Improved `checked_isqrt` and `isqrt` methods
    
    ### Improved tests of `isqrt` and `checked_isqrt` implementations
    
    * Inputs chosen more thoroughly and systematically.
    * Checks that `isqrt` and `checked_isqrt` have equivalent results for signed types, either equivalent numerically or equivalent as a panic and a `None`.
    * Checks that `isqrt` has numerically-equivalent results for unsigned types and their `NonZero` counterparts.
    
    ### Added benchmarks for `isqrt` implementations
    
    ### Greatly sped up `checked_isqrt` and `isqrt` methods
    
    * Uses a lookup table for 8-bit integers and then the Karatsuba square root algorithm for larger integers.
    * Includes optimization hints that give the compiler the exact numeric range of results.
    
    ### Feature tracking issue
    
    `isqrt` is an unstable feature tracked at rust-lang#116226.
    
    <details><summary>Benchmarked improvements</summary>
    
    ### Command used to benchmark
    
        ./x bench library/core -- int_sqrt
    
    ### Before
    
        benchmarks:
            num::int_sqrt::i128::isqrt           439591.65/iter  +/- 6652.70
            num::int_sqrt::i16::isqrt              5302.97/iter   +/- 160.93
            num::int_sqrt::i32::isqrt             62999.11/iter  +/- 2022.05
            num::int_sqrt::i64::isqrt            125248.81/iter  +/- 1674.43
            num::int_sqrt::i8::isqrt                123.56/iter     +/- 1.87
            num::int_sqrt::isize::isqrt          125356.56/iter  +/- 1017.03
            num::int_sqrt::non_zero_u128::isqrt  437443.75/iter  +/- 3535.43
            num::int_sqrt::non_zero_u16::isqrt     8604.58/iter    +/- 94.76
            num::int_sqrt::non_zero_u32::isqrt    62933.33/iter   +/- 517.30
            num::int_sqrt::non_zero_u64::isqrt   125076.38/iter +/- 11340.61
            num::int_sqrt::non_zero_u8::isqrt       221.51/iter     +/- 1.58
            num::int_sqrt::non_zero_usize::isqrt 136005.21/iter  +/- 2020.35
            num::int_sqrt::u128::isqrt           439014.55/iter  +/- 3920.45
            num::int_sqrt::u16::isqrt              8575.08/iter   +/- 148.06
            num::int_sqrt::u32::isqrt             63008.89/iter   +/- 803.67
            num::int_sqrt::u64::isqrt            125088.09/iter   +/- 879.29
            num::int_sqrt::u8::isqrt                230.18/iter     +/- 2.04
            num::int_sqrt::usize::isqrt          125237.51/iter  +/- 4747.83
    ### After
    
        benchmarks:
            num::int_sqrt::i128::isqrt           105184.89/iter +/- 1171.38
            num::int_sqrt::i16::isqrt              1910.26/iter   +/- 78.50
            num::int_sqrt::i32::isqrt             34260.34/iter  +/- 960.84
            num::int_sqrt::i64::isqrt             45939.19/iter +/- 2525.65
            num::int_sqrt::i8::isqrt                 22.87/iter    +/- 0.45
            num::int_sqrt::isize::isqrt           45884.17/iter  +/- 595.49
            num::int_sqrt::non_zero_u128::isqrt  106344.27/iter  +/- 780.99
            num::int_sqrt::non_zero_u16::isqrt     2790.19/iter   +/- 53.43
            num::int_sqrt::non_zero_u32::isqrt    33613.99/iter  +/- 362.96
            num::int_sqrt::non_zero_u64::isqrt    46235.42/iter  +/- 429.69
            num::int_sqrt::non_zero_u8::isqrt        31.78/iter    +/- 0.75
            num::int_sqrt::non_zero_usize::isqrt  46208.75/iter  +/- 375.27
            num::int_sqrt::u128::isqrt           106385.94/iter +/- 1649.95
            num::int_sqrt::u16::isqrt              2747.69/iter   +/- 28.72
            num::int_sqrt::u32::isqrt             33627.09/iter  +/- 475.68
            num::int_sqrt::u64::isqrt             46182.29/iter  +/- 311.16
            num::int_sqrt::u8::isqrt                 33.10/iter    +/- 0.30
            num::int_sqrt::usize::isqrt           46165.00/iter  +/- 388.41
    
    </details>
    matthiaskrgr authored Aug 26, 2024
    Configuration menu
    Copy the full SHA
    7e1143b View commit details
    Browse the repository at this point in the history
  12. Rollup merge of rust-lang#129032 - jswrenn:transmute-method, r=compil…

    …er-errors
    
    Document & implement the transmutation modeled by `BikeshedIntrinsicFrom`
    
    Documents that `BikeshedIntrinsicFrom` models transmute-via-union, which is slightly more expressive than the transmute-via-cast implemented by `transmute_copy`. Additionally, we provide an implementation of transmute-via-union as a method on the `BikeshedIntrinsicFrom` trait with additional documentation on the boundary between trait invariants and caller obligations.
    
    Whether or not transmute-via-union is the right kind of transmute to model remains up for discussion [1]. Regardless, it seems wise to document the present behavior.
    
    [1] https://rust-lang.zulipchat.com/#narrow/stream/216762-project-safe-transmute/topic/What.20'kind'.20of.20transmute.20to.20model.3F/near/426331967
    
    Tracking Issue: rust-lang#99571
    
    r? `@compiler-errors`
    
    cc `@scottmcm,` `@Lokathor`
    matthiaskrgr authored Aug 26, 2024
    Configuration menu
    Copy the full SHA
    77fb9a3 View commit details
    Browse the repository at this point in the history
  13. Rollup merge of rust-lang#129250 - estebank:issue-129205, r=compiler-…

    …errors
    
    Do not ICE on non-ADT rcvr type when looking for crate version collision
    
    When looking for multiple versions of the same crate, do not blindly construct the receiver type.
    
    Follow up to rust-lang#128786.
    Fixes rust-lang#129205
    Fixes rust-lang#129216
    matthiaskrgr authored Aug 26, 2024
    Configuration menu
    Copy the full SHA
    28c4516 View commit details
    Browse the repository at this point in the history
  14. Rollup merge of rust-lang#129560 - GuillaumeGomez:impl-assoc-type-sou…

    …rce-link, r=notriddle
    
    [rustdoc] Generate source link on impl associated types
    
    Currently, impl associated types are generated but don't get a source link. This PR fixes that.
    
    Before:
    
    ![image](https://github.com/user-attachments/assets/3a22adb5-8b66-4124-9267-7c26eed1aa5e)
    
    After:
    
    ![Screenshot from 2024-08-25 16-31-36](https://github.com/user-attachments/assets/6e9b35e7-4357-4ecf-8c49-1d8294051283)
    
    r? `@notriddle`
    matthiaskrgr authored Aug 26, 2024
    Configuration menu
    Copy the full SHA
    ca124b5 View commit details
    Browse the repository at this point in the history
  15. Rollup merge of rust-lang#129622 - bjorn3:less_unstable, r=lqd

    Remove a couple of unused feature enables
    matthiaskrgr authored Aug 26, 2024
    Configuration menu
    Copy the full SHA
    ead5741 View commit details
    Browse the repository at this point in the history
  16. Rollup merge of rust-lang#129625 - compiler-errors:generic-args-mode,…

    … r=fmease
    
    Rename `ParenthesizedGenericArgs` to `GenericArgsMode`
    
    A bit easier to digest name. Broken out of a PR implementing return type notation.
    matthiaskrgr authored Aug 26, 2024
    Configuration menu
    Copy the full SHA
    3631904 View commit details
    Browse the repository at this point in the history
  17. Rollup merge of rust-lang#129626 - compiler-errors:explicit-named, r=…

    …fmease
    
    Remove `ParamMode::ExplicitNamed`
    
    This was introduced as a hack to improve a diagnostics suggestion in rust-lang#61679. It was subsequently broken, but also it was an incomplete hack that I don't believe we need to support, so let's just remove it.
    matthiaskrgr authored Aug 26, 2024
    Configuration menu
    Copy the full SHA
    ed88bdd View commit details
    Browse the repository at this point in the history