forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#117996 - matthiaskrgr:rollup-sp48bl4, r=matth…
…iaskrgr Rollup of 5 pull requests Successful merges: - rust-lang#117892 (Detect more `=>` typos) - rust-lang#117959 (Better handle type errors involving `Self` literals) - rust-lang#117980 (fix: Update CONTRIBUTING.md recommend -> recommended) - rust-lang#117982 (bootstrap: only show PGO warnings when verbose) - rust-lang#117990 (Tweak error and move tests) Failed merges: - rust-lang#117944 (some additional region refactorings) r? `@ghost` `@rustbot` modify labels: rollup
- Loading branch information
Showing
74 changed files
with
193 additions
and
28 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// run-rustfix | ||
fn main() { | ||
match 1 { | ||
1 => {} //~ ERROR | ||
_ => { let _: u16 = 2u16; } //~ ERROR | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// run-rustfix | ||
fn main() { | ||
match 1 { | ||
1 >= {} //~ ERROR | ||
_ => { let _: u16 = 2u8; } //~ ERROR | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
error: expected one of `...`, `..=`, `..`, `=>`, `if`, or `|`, found `>=` | ||
--> $DIR/recover-ge-as-fat-arrow.rs:4:11 | ||
| | ||
LL | 1 >= {} | ||
| ^^ | ||
| | | ||
| expected one of `...`, `..=`, `..`, `=>`, `if`, or `|` | ||
| help: use a fat arrow to start a match arm: `=>` | ||
|
||
error[E0308]: mismatched types | ||
--> $DIR/recover-ge-as-fat-arrow.rs:5:29 | ||
| | ||
LL | _ => { let _: u16 = 2u8; } | ||
| --- ^^^ expected `u16`, found `u8` | ||
| | | ||
| expected due to this | ||
| | ||
help: change the type of the numeric literal from `u8` to `u16` | ||
| | ||
LL | _ => { let _: u16 = 2u16; } | ||
| ~~~ | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0308`. |
This file contains 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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
14 changes: 14 additions & 0 deletions
14
tests/ui/parser/recover/recover-parens-around-match-arm-head.rs
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
fn main() { | ||
let val = 42; | ||
let x = match val { | ||
(0 if true) => { | ||
//~^ ERROR expected identifier, found keyword `if` | ||
//~| ERROR expected one of `)`, `,`, `...`, `..=`, `..`, or `|`, found keyword `if` | ||
//~| ERROR expected one of `)`, `,`, `@`, or `|`, found keyword `true` | ||
//~| ERROR mismatched types | ||
42u8 | ||
} | ||
_ => 0u8, | ||
}; | ||
let _y: u32 = x; //~ ERROR mismatched types | ||
} |
49 changes: 49 additions & 0 deletions
49
tests/ui/parser/recover/recover-parens-around-match-arm-head.stderr
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
error: expected identifier, found keyword `if` | ||
--> $DIR/recover-parens-around-match-arm-head.rs:4:12 | ||
| | ||
LL | (0 if true) => { | ||
| ^^ expected identifier, found keyword | ||
|
||
error: expected one of `)`, `,`, `...`, `..=`, `..`, or `|`, found keyword `if` | ||
--> $DIR/recover-parens-around-match-arm-head.rs:4:12 | ||
| | ||
LL | (0 if true) => { | ||
| -^^ expected one of `)`, `,`, `...`, `..=`, `..`, or `|` | ||
| | | ||
| help: missing `,` | ||
|
||
error: expected one of `)`, `,`, `@`, or `|`, found keyword `true` | ||
--> $DIR/recover-parens-around-match-arm-head.rs:4:15 | ||
| | ||
LL | (0 if true) => { | ||
| -^^^^ expected one of `)`, `,`, `@`, or `|` | ||
| | | ||
| help: missing `,` | ||
|
||
error[E0308]: mismatched types | ||
--> $DIR/recover-parens-around-match-arm-head.rs:4:9 | ||
| | ||
LL | let x = match val { | ||
| --- this expression has type `{integer}` | ||
LL | (0 if true) => { | ||
| ^^^^^^^^^^^ expected integer, found `(_, _, _)` | ||
| | ||
= note: expected type `{integer}` | ||
found tuple `(_, _, _)` | ||
|
||
error[E0308]: mismatched types | ||
--> $DIR/recover-parens-around-match-arm-head.rs:13:19 | ||
| | ||
LL | let _y: u32 = x; | ||
| --- ^ expected `u32`, found `u8` | ||
| | | ||
| expected due to this | ||
| | ||
help: you can convert a `u8` to a `u32` | ||
| | ||
LL | let _y: u32 = x.into(); | ||
| +++++++ | ||
|
||
error: aborting due to 5 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0308`. |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains 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
This file contains 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