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

Merged
merged 18 commits into from
Feb 1, 2023
Merged

Rollup of 6 pull requests #107546

merged 18 commits into from
Feb 1, 2023

Commits on Jan 27, 2023

  1. Fixed confusement between mod and remainder

    Matthias Kaak committed Jan 27, 2023
    Configuration menu
    Copy the full SHA
    e02517d View commit details
    Browse the repository at this point in the history

Commits on Jan 30, 2023

  1. Configuration menu
    Copy the full SHA
    385dbff View commit details
    Browse the repository at this point in the history
  2. bootstrap: --help handling

    kadiwa4 committed Jan 30, 2023
    Configuration menu
    Copy the full SHA
    b925031 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    8d7b092 View commit details
    Browse the repository at this point in the history
  4. Ran rustfmt

    Matthias Kaak committed Jan 30, 2023
    Configuration menu
    Copy the full SHA
    af9671f View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    e905b93 View commit details
    Browse the repository at this point in the history

Commits on Jan 31, 2023

  1. Configuration menu
    Copy the full SHA
    7892cc3 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    043c634 View commit details
    Browse the repository at this point in the history
  3. Extend -Z print-type-sizes to distinguish generator upvars and loca…

    …ls from "normal" ADT fields.
    pnkfelix committed Jan 31, 2023
    Configuration menu
    Copy the full SHA
    a37b306 View commit details
    Browse the repository at this point in the history
  4. placate tidy.

    pnkfelix committed Jan 31, 2023
    Configuration menu
    Copy the full SHA
    91f1b22 View commit details
    Browse the repository at this point in the history
  5. improve panic message for slice windows and chunks

    Lukas Markeffsky committed Jan 31, 2023
    Configuration menu
    Copy the full SHA
    2fbe927 View commit details
    Browse the repository at this point in the history

Commits on Feb 1, 2023

  1. Configuration menu
    Copy the full SHA
    362c4fa View commit details
    Browse the repository at this point in the history
  2. Rollup merge of rust-lang#107389 - zvavybir:master, r=estebank

    Fixing confusion between mod and remainder
    
    Like many programming languages, rust too confuses remainder and modulus.  The `%` operator and the associated `Rem` trait is (as the trait name suggests) the remainder, but since most people are linguistically more familiar with the modulus the documentation sometimes claims otherwise.  This PR tries to fix this problem in rustc.
    matthiaskrgr authored Feb 1, 2023
    Configuration menu
    Copy the full SHA
    0d2ab67 View commit details
    Browse the repository at this point in the history
  3. Rollup merge of rust-lang#107442 - lukas-code:slice-panics, r=cuviper

    improve panic message for slice windows and chunks
    
    before:
    ```text
    thread 'main' panicked at 'size is zero', /rustc/1e225413a21fa69570bd3fefea9eb05e33f8b917/library/core/src/slice/mod.rs:809:44
    ```
    ```text
    thread 'main' panicked at 'assertion failed: `(left != right)`
      left: `0`,
     right: `0`: chunks cannot have a size of zero', /rustc/1e225413a21fa69570bd3fefea9eb05e33f8b917/library/core/src/slice/mod.rs:843:9
    ```
    
    after:
    ```text
    thread 'main' panicked at 'chunk size must be non-zero', src/main.rs:4:22
    ```
    
    fixes rust-lang#107437
    matthiaskrgr authored Feb 1, 2023
    Configuration menu
    Copy the full SHA
    1dbb5ef View commit details
    Browse the repository at this point in the history
  4. Rollup merge of rust-lang#107470 - kadiwa4:bootstrap_cleanup, r=alber…

    …tlarsan68
    
    Small bootstrap improvements
    
    - i/o-less check for `xz` availability
    - cache result of NixOS detection
    - load correct `bootstrap` module even when a package of that name is installed
    - no `-W semicolon_in_expressions_from_macros` – it is warn-by-default
    - one type per variable (making dynamic typing less confusing)
    - integrate python-side `--help` flag into the argument parser (makes `-hv` work as a short form of `--help --verbose`)
    
    I even checked that it works with Python 2.
    matthiaskrgr authored Feb 1, 2023
    Configuration menu
    Copy the full SHA
    b853b22 View commit details
    Browse the repository at this point in the history
  5. Rollup merge of rust-lang#107487 - edward-shen:edward-shen/107213-rou…

    …nd-2, r=estebank
    
    Make the "extra if in let...else block" hint a suggestion
    
    Changes the hint to a suggestion, suggested in rust-lang#107213.
    
    r? ```@estebank```
    matthiaskrgr authored Feb 1, 2023
    Configuration menu
    Copy the full SHA
    6390d25 View commit details
    Browse the repository at this point in the history
  6. Rollup merge of rust-lang#107499 - compiler-errors:deduce_sig_from_pr…

    …ojection-generator-tweak, r=michaelwoerister
    
    Do not depend on Generator trait when deducing closure signature
    
    1. Do not depend on `Generator` trait when deducing closure signature.
    2. Compare the name of the `Generator::Return` associated item, rather than its order in the trait. Seems more stable this way.
    matthiaskrgr authored Feb 1, 2023
    Configuration menu
    Copy the full SHA
    a37a59f View commit details
    Browse the repository at this point in the history
  7. Rollup merge of rust-lang#107533 - pnkfelix:distinguish-generator-sta…

    …te-in-print-type-sizes, r=compiler-errors
    
    Extend `-Z print-type-sizes` to distinguish generator upvars+locals from "normal" fields.
    
    For example, for this code:
    
    ```rust
    async fn wait() {}
    
    async fn test(arg: [u8; 8192]) {
        wait().await;
        drop(arg);
    }
    
    async fn test_ideal(_rg: [u8; 8192]) {
        wait().await;
        // drop(arg);
    }
    
    fn main() {
        let gen_t = test([0; 8192]);
        let gen_i = test_ideal([0; 8192]);
        println!("expect {}, got: {}",
                 std::mem::size_of_val(&gen_i),
                 std::mem::size_of_val(&gen_t));
    }
    ```
    
    the `-Z print-type-sizes` output used to start with:
    
    ```
    print-type-size type: `[async fn body@issue-62958-a.rs:3:32: 6:2]`: 16386 bytes, alignment: 1 bytes
    print-type-size     discriminant: 1 bytes
    print-type-size     variant `Suspend0`: 16385 bytes
    print-type-size         field `.arg`: 8192 bytes, offset: 0 bytes, alignment: 1 bytes
    print-type-size         field `.arg`: 8192 bytes
    print-type-size         field `.__awaitee`: 1 bytes
    ...
    print-type-size type: `std::mem::ManuallyDrop<[u8; 8192]>`: 8192 bytes, alignment: 1 bytes
    print-type-size     field `.value`: 8192 bytes
    ...
    ```
    
    but with this change, it now instead prints:
    
    ```
    print-type-size type: `[async fn body@issue-62958-a.rs:3:32: 6:2]`: 16386 bytes, alignment: 1 bytes
    print-type-size     discriminant: 1 bytes
    print-type-size     variant `Suspend0`: 16385 bytes
    print-type-size         upvar `.arg`: 8192 bytes, offset: 0 bytes, alignment: 1 bytes
    print-type-size         local `.arg`: 8192 bytes
    print-type-size         local `.__awaitee`: 1 bytes
    ...
    print-type-size type: `std::mem::ManuallyDrop<[u8; 8192]>`: 8192 bytes, alignment: 1 bytes
    print-type-size     field `.value`: 8192 bytes
    ```
    
    (spawned off of investigation of rust-lang#62958 )
    matthiaskrgr authored Feb 1, 2023
    Configuration menu
    Copy the full SHA
    f41f154 View commit details
    Browse the repository at this point in the history