forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#105502 - chenyukang:yukang/fix-105366-impl,…
… r=estebank Suggest impl in the scenario of typo with fn Fixes rust-lang#105366
- Loading branch information
Showing
6 changed files
with
66 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// run-rustfix | ||
|
||
struct Foo; | ||
|
||
impl From<i32> for Foo { | ||
//~^ ERROR you might have meant to write `impl` instead of `fn` | ||
fn from(_a: i32) -> Self { | ||
Foo | ||
} | ||
} | ||
|
||
fn main() {} |
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,12 @@ | ||
// run-rustfix | ||
|
||
struct Foo; | ||
|
||
fn From<i32> for Foo { | ||
//~^ ERROR you might have meant to write `impl` instead of `fn` | ||
fn from(_a: i32) -> Self { | ||
Foo | ||
} | ||
} | ||
|
||
fn main() {} |
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,13 @@ | ||
error: you might have meant to write `impl` instead of `fn` | ||
--> $DIR/issue-105366.rs:5:1 | ||
| | ||
LL | fn From<i32> for Foo { | ||
| ^^ | ||
| | ||
help: replace `fn` with `impl` here | ||
| | ||
LL | impl From<i32> for Foo { | ||
| ~~~~ | ||
|
||
error: aborting due to previous error | ||
|