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

Closed
wants to merge 23 commits into from

Commits on Aug 15, 2024

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

Commits on Aug 24, 2024

  1. Configuration menu
    Copy the full SHA
    42a901a View commit details
    Browse the repository at this point in the history
  2. Deny wasm_c_abi lint to nudge the last 25%

    This shouldn't affect projects indirectly depending on wasm-bindgen
    because cargo passes `--cap-lints=allow` when building dependencies.
    workingjubilee committed Aug 24, 2024
    Configuration menu
    Copy the full SHA
    af05882 View commit details
    Browse the repository at this point in the history

Commits on Aug 26, 2024

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

Commits on Aug 27, 2024

  1. Configuration menu
    Copy the full SHA
    f1e2991 View commit details
    Browse the repository at this point in the history
  2. bless miri tests

    joboet committed Aug 27, 2024
    Configuration menu
    Copy the full SHA
    cfbd250 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    a1c36c6 View commit details
    Browse the repository at this point in the history
  4. linker: Better support alternative static library naming on MSVC

    Previously `libname.a` naming was supported as a fallback when producing rlibs, but not when producing executables or dynamic libraries
    petrochenkov committed Aug 27, 2024
    Configuration menu
    Copy the full SHA
    05bd36d View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    ac8f132 View commit details
    Browse the repository at this point in the history

Commits on Aug 28, 2024

  1. Configuration menu
    Copy the full SHA
    ee05de8 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    83de14c View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    ae6f8a7 View commit details
    Browse the repository at this point in the history

Commits on Aug 29, 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 29, 2024
    Configuration menu
    Copy the full SHA
    0cac915 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 29, 2024
    Configuration menu
    Copy the full SHA
    7af8e21 View commit details
    Browse the repository at this point in the history
  3. Rollup merge of rust-lang#120221 - compiler-errors:statements-are-not…

    …-patterns, r=nnethercote
    
    Don't make statement nonterminals match pattern nonterminals
    
    Right now, the heuristic we use to check if a token may begin a pattern nonterminal falls back to `may_be_ident`:
    https://github.com/rust-lang/rust/blob/ef71f1047e04438181d7cb925a833e2ada6ab390/compiler/rustc_parse/src/parser/nonterminal.rs#L21-L37
    
    This has the unfortunate side effect that a `stmt` nonterminal eagerly matches against a `pat` nonterminal, leading to a parse error:
    ```rust
    macro_rules! m {
        ($pat:pat) => {};
        ($stmt:stmt) => {};
    }
    
    macro_rules! m2 {
        ($stmt:stmt) => {
            m! { $stmt }
        };
    }
    
    m2! { let x = 1 }
    ```
    
    This PR fixes it by more accurately reflecting the set of nonterminals that may begin a pattern nonterminal.
    
    As a side-effect, I modified `Token::can_begin_pattern` to work correctly and used that in `Parser::nonterminal_may_begin_with`.
    workingjubilee authored Aug 29, 2024
    Configuration menu
    Copy the full SHA
    120e437 View commit details
    Browse the repository at this point in the history
  4. Rollup merge of rust-lang#127912 - joboet:tls_dtor_thread_current, r=…

    …cupiver
    
    std: make `thread::current` available in all `thread_local!` destructors
    
    ... and thereby allow the panic runtime to always print the right thread name.
    
    This works by modifying the TLS destructor system to schedule a runtime cleanup function after all other TLS destructors registered by `std` have run. Unfortunately, this doesn't affect foreign TLS destructors, `thread::current` will still panic there.
    
    Additionally, the thread ID returned by `current_id` will now always be available, even inside the global allocator, and will not change during the lifetime of one thread (this was previously the case with key-based TLS).
    
    The mechanisms I added for this (`local_pointer` and `thread_cleanup`) will also allow finally fixing rust-lang#111272 by moving the signal stack to a similar runtime-cleanup TLS variable.
    workingjubilee authored Aug 29, 2024
    Configuration menu
    Copy the full SHA
    772a670 View commit details
    Browse the repository at this point in the history
  5. 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>
    
    Tracking Issue for {u8,i8,...}::isqrt rust-lang#116226
    
    try-job: test-various
    workingjubilee authored Aug 29, 2024
    Configuration menu
    Copy the full SHA
    0e039de View commit details
    Browse the repository at this point in the history
  6. Rollup merge of rust-lang#129123 - aDotInTheVoid:rustdoc-json-self, r…

    …=fmease
    
    rustdoc-json: Add test for `Self` type
    
    Inspired by rust-lang#128471, the rustdoc-json suite had no tests in place for the `Self` type. This PR adds one.
    
    I've also manually checked locally that this test passes on 29e9248, confirming that adding `clean::Type::SelfTy` didn't change the JSON output. (potentially adding a self type to json (insead of (ab)using generic) is tracked in rust-lang#128522)
    
    Updates rust-lang#81359
    
    r? `@fmease`
    workingjubilee authored Aug 29, 2024
    Configuration menu
    Copy the full SHA
    10db657 View commit details
    Browse the repository at this point in the history
  7. Rollup merge of rust-lang#129366 - petrochenkov:libsearch, r=jieyouxu

    linker: Synchronize native library search in rustc and linker
    
    Also search for static libraries with alternative naming (`libname.a`) on MSVC when producing executables or dynamic libraries, and not just rlibs.
    
    This unblocks rust-lang#123436.
    
    try-job: x86_64-msvc
    workingjubilee authored Aug 29, 2024
    Configuration menu
    Copy the full SHA
    9d9c153 View commit details
    Browse the repository at this point in the history
  8. Rollup merge of rust-lang#129527 - compiler-errors:lint-nit, r=Nadrieril

    Don't use `TyKind` in a lint
    
    Allows us to remove an inherent method from `TyKind` from the type ir crate.
    workingjubilee authored Aug 29, 2024
    Configuration menu
    Copy the full SHA
    8f2dad9 View commit details
    Browse the repository at this point in the history
  9. Rollup merge of rust-lang#129534 - workingjubilee:ratchet-wasm-c-abi-…

    …fcw-to-deny, r=daxpedda,alexcrichton
    
    Deny `wasm_c_abi` lint to nudge the last 25%
    
    This shouldn't affect projects indirectly depending on wasm-bindgen because cargo passes `--cap-lints=allow` when building dependencies.
    
    The motivation is that the ecosystem has mostly taken up the versions of wasm-bindgen that are compatible in general, but ~25% or so of recent downloads remain on lower versions. However, this change might still be unnecessarily disruptive. I mostly propose it as a discussion point.
    workingjubilee authored Aug 29, 2024
    Configuration menu
    Copy the full SHA
    a4ae0e3 View commit details
    Browse the repository at this point in the history
  10. Rollup merge of rust-lang#129640 - saethlin:unignore-android-in-alloc…

    …, r=tgross35
    
    Re-enable android tests/benches in alloc/core
    
    This is basically a revert of rust-lang#73729. These tests better work on android now; it's been 4 years and we don't use dlmalloc on that target anymore.
    
    And I've validated that they should pass now with a try-build :)
    workingjubilee authored Aug 29, 2024
    Configuration menu
    Copy the full SHA
    09a2515 View commit details
    Browse the repository at this point in the history
  11. Rollup merge of rust-lang#129675 - lolbinarycat:bufreader_peek_unsize…

    …d, r=workingjubilee
    
    allow BufReader::peek to be called on unsized types
    
    rust-lang#128405
    workingjubilee authored Aug 29, 2024
    Configuration menu
    Copy the full SHA
    6027230 View commit details
    Browse the repository at this point in the history