-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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 #74210 - estebank:type-ascriptomatic, r=petrochenkov
Deduplicate `::` -> `:` typo errors Deduplicate errors caused by the same type ascription typo, including ones suggested during parsing that would get reported again during resolve. Fix #70382.
- Loading branch information
Showing
28 changed files
with
212 additions
and
181 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// run-rustfix | ||
struct X {} | ||
fn main() { | ||
let _ = vec![X {}]; //… | ||
//~^ ERROR expected value, found struct `X` | ||
} |
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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
// run-rustfix | ||
struct X {} | ||
fn main() { | ||
vec![X]; //… | ||
let _ = vec![X]; //… | ||
//~^ ERROR expected value, found struct `X` | ||
} |
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
5 changes: 5 additions & 0 deletions
5
src/test/ui/suggestions/type-ascription-instead-of-method.fixed
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,5 @@ | ||
// run-rustfix | ||
fn main() { | ||
let _ = Box::new("foo".to_string()); | ||
//~^ ERROR expected type, found | ||
} |
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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
// run-rustfix | ||
fn main() { | ||
Box:new("foo".to_string()) | ||
let _ = Box:new("foo".to_string()); | ||
//~^ ERROR expected type, found | ||
} |
10 changes: 5 additions & 5 deletions
10
src/test/ui/suggestions/type-ascription-instead-of-method.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
6 changes: 6 additions & 0 deletions
6
src/test/ui/suggestions/type-ascription-instead-of-path-2.fixed
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,6 @@ | ||
// run-rustfix | ||
fn main() -> Result<(), ()> { | ||
let _ = vec![Ok(2)].into_iter().collect::<Result<Vec<_>,_>>()?; | ||
//~^ ERROR expected `::`, found `(` | ||
Ok(()) | ||
} |
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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
// run-rustfix | ||
fn main() -> Result<(), ()> { | ||
vec![Ok(2)].into_iter().collect:<Result<Vec<_>,_>>()?; | ||
let _ = vec![Ok(2)].into_iter().collect:<Result<Vec<_>,_>>()?; | ||
//~^ ERROR expected `::`, found `(` | ||
Ok(()) | ||
} |
10 changes: 5 additions & 5 deletions
10
src/test/ui/suggestions/type-ascription-instead-of-path-2.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
5 changes: 5 additions & 0 deletions
5
src/test/ui/suggestions/type-ascription-instead-of-variant.fixed
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,5 @@ | ||
// run-rustfix | ||
fn main() { | ||
let _ = Option::Some(""); | ||
//~^ ERROR expected type, found | ||
} |
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
// run-rustfix | ||
fn main() { | ||
let _ = Option:Some(""); | ||
//~^ ERROR expected type, found | ||
|
Oops, something went wrong.