Merged
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 )
Member
Author
|
@bors r+ rollup=never p=6 |
Collaborator
Collaborator
Collaborator
|
☀️ Test successful - checks-actions |
Collaborator
|
📌 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: |
Collaborator
|
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Successful merges:
-Z print-type-sizesto distinguish generator upvars+locals from "normal" fields. #107533 (Extend-Z print-type-sizesto distinguish generator upvars+locals from "normal" fields.)Failed merges:
r? @ghost
@rustbot modify labels: rollup
Create a similar rollup