forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 7
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#130870 - surechen:fix_130791, r=compiler-errors Add suggestion for removing invalid path sep `::` in fn def Add suggestion for removing invalid path separator `::` in function definition. for example: `fn invalid_path_separator::<T>() {}` fixes rust-lang#130791
- Loading branch information
Showing
6 changed files
with
46 additions
and
0 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
7 changes: 7 additions & 0 deletions
7
tests/ui/parser/issues/invalid-path-sep-in-fn-definition-issue-130791.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,7 @@ | ||
//@ run-rustfix | ||
|
||
#[allow(dead_code)] | ||
fn invalid_path_separator<T>() {} | ||
//~^ ERROR invalid path separator in function definition | ||
|
||
fn main() {} |
7 changes: 7 additions & 0 deletions
7
tests/ui/parser/issues/invalid-path-sep-in-fn-definition-issue-130791.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,7 @@ | ||
//@ run-rustfix | ||
|
||
#[allow(dead_code)] | ||
fn invalid_path_separator::<T>() {} | ||
//~^ ERROR invalid path separator in function definition | ||
|
||
fn main() {} |
14 changes: 14 additions & 0 deletions
14
tests/ui/parser/issues/invalid-path-sep-in-fn-definition-issue-130791.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,14 @@ | ||
error: invalid path separator in function definition | ||
--> $DIR/invalid-path-sep-in-fn-definition-issue-130791.rs:4:26 | ||
| | ||
LL | fn invalid_path_separator::<T>() {} | ||
| ^^ | ||
| | ||
help: remove invalid path separator | ||
| | ||
LL - fn invalid_path_separator::<T>() {} | ||
LL + fn invalid_path_separator<T>() {} | ||
| | ||
|
||
error: aborting due to 1 previous error | ||
|