-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Rollup of 6 pull requests #107546
Conversation
…ls from "normal" ADT fields.
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.
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
…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.
…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```
…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.
…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 )
@bors r+ rollup=never p=6 |
☀️ Test successful - checks-actions |
📌 Perf builds for each rolled up PR: previous master: 0d32c8f2ce In the case of a perf regression, run the following command for each PR you suspect might be the cause: |
Finished benchmarking commit (3b63948): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesThis benchmark run did not return any relevant results for this metric. |
Successful merges:
-Z print-type-sizes
to distinguish generator upvars+locals from "normal" fields. #107533 (Extend-Z print-type-sizes
to distinguish generator upvars+locals from "normal" fields.)Failed merges:
r? @ghost
@rustbot modify labels: rollup
Create a similar rollup