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

Closed
wants to merge 12 commits into from
Closed

Commits on Oct 20, 2022

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

Commits on Oct 23, 2022

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

Commits on Oct 24, 2022

  1. Configuration menu
    Copy the full SHA
    f54c336 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    0fca075 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    b6824ba View commit details
    Browse the repository at this point in the history

Commits on Oct 25, 2022

  1. Configuration menu
    Copy the full SHA
    919673e View commit details
    Browse the repository at this point in the history
  2. Rollup merge of rust-lang#100452 - ouz-a:issue-93242, r=jackh726

    Fake capture closures if typeck results are empty
    
    This ICE happens because `closure_min_captures` is empty, the reason it's empty is with the 2021 edition `enable_precise_capture` is set to true, which makes it so that we can't fake capture any information because that result of the `unwrap` is none hence the ICE.
    
    Other solution is editing [maybe_read_scrutinee](https://doc.rust-lang.org/nightly/nightly-rustc/src/rustc_typeck/expr_use_visitor.rs.html#453-463) to this since empty slice contains no sub patterns.
    
    Fixes rust-lang#93242
    
    ```rust
    PatKind::Slice(_, ref slice, _) => {
        if slice.is_none(){
        need_to_be_read = true;
        }
    }
    // instead of
    PatKind::Or(_)
    | PatKind::Box(_)
    | PatKind::Slice(..)
    | PatKind::Ref(..)
    | PatKind::Wild => {}
    ```
    Dylan-DPC authored Oct 25, 2022
    Configuration menu
    Copy the full SHA
    8c5d4e6 View commit details
    Browse the repository at this point in the history
  3. Rollup merge of rust-lang#102951 - SparrowLii:type_annotation, r=este…

    …bank
    
    suggest type annotation for local statement initialed by ref expression
    
    In a local statement with a type declaration, if a ref expression is used on the right side and not used on the left side, in addition to removing the `&` and `&mut` on the right side, we can add them on the left side alternatively
    Fixes rust-lang#102892
    Dylan-DPC authored Oct 25, 2022
    Configuration menu
    Copy the full SHA
    ba39aab View commit details
    Browse the repository at this point in the history
  4. Rollup merge of rust-lang#103287 - saethlin:faster-len-check, r=thomcc

    Use a faster allocation size check in slice::from_raw_parts
    
    I've been perusing through the codegen changes that result from turning on the standard library debug assertions. The previous check in here uses saturating arithmetic, which in my experience sometimes makes LLVM just fail to optimize things around the saturating operation.
    
    Here is a demo of the codegen difference: https://godbolt.org/z/WMEqrjajW
    Before:
    ```asm
    example::len_check_old:
            mov     rax, rdi
            mov     ecx, 3
            mul     rcx
            setno   cl
            test    rax, rax
            setns   al
            and     al, cl
            ret
    
    example::len_check_old:
            mov     rax, rdi
            mov     ecx, 8
            mul     rcx
            setno   cl
            test    rax, rax
            setns   al
            and     al, cl
            ret
    ```
    After:
    ```asm
    example::len_check_new:
            movabs  rax, 3074457345618258603
            cmp     rdi, rax
            setb    al
            ret
    
    example::len_check_new:
            shr     rdi, 60
            sete    al
            ret
    ```
    
    Running rustc-perf locally, this looks like up to a 4.5% improvement when `debug-assertions-std = true`.
    
    Thanks `@LegionMammal978` (I think that's you?) for turning my idea into a much cleaner implementation.
    
    r? `@thomcc`
    Dylan-DPC authored Oct 25, 2022
    Configuration menu
    Copy the full SHA
    d79eb6b View commit details
    Browse the repository at this point in the history
  5. Rollup merge of rust-lang#103444 - chenyukang:yukang/fix-103425-extra…

    …-diag, r=davidtwco
    
    Remove extra type error after missing semicolon error
    
    Fixes rust-lang#103425
    Dylan-DPC authored Oct 25, 2022
    Configuration menu
    Copy the full SHA
    d0ce4d5 View commit details
    Browse the repository at this point in the history
  6. Rollup merge of rust-lang#103475 - oli-obk:generic_param_indices, r=lcnr

    Make param index generation a bit more robust
    
    r? ``@lcnr``
    
    While not really necessary for closure and anon const ids, it's strictly more correct
    Dylan-DPC authored Oct 25, 2022
    Configuration menu
    Copy the full SHA
    646e13e View commit details
    Browse the repository at this point in the history
  7. Rollup merge of rust-lang#103520 - petrochenkov:resout, r=cjgillot

    rustc_middle: Rearrange resolver outputs structures slightly
    
    Addresses rust-lang#98106 (comment).
    I also haven't seen the motivation for moving `cstore` from its old place, so I moved it back in this PR.
    r? `@cjgillot`
    Dylan-DPC authored Oct 25, 2022
    Configuration menu
    Copy the full SHA
    288655f View commit details
    Browse the repository at this point in the history