-
Notifications
You must be signed in to change notification settings - Fork 13k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
better suggestion for duplicated
where
- Loading branch information
1 parent
1ea4851
commit f35d43c
Showing
6 changed files
with
147 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
struct A where T: Sized ! | ||
//~^ ERROR expected `{` after struct name, 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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
error: expected `{` after struct name, found `!` | ||
--> $DIR/bad-struct-following-where.rs:1:25 | ||
| | ||
LL | struct A where T: Sized ! | ||
| ^ expected `{` after struct name | ||
|
||
error: aborting due to previous 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,19 @@ | ||
struct A where (): Sized where (): Sized {} | ||
//~^ ERROR cannot define duplicate `where` clauses on an item | ||
|
||
fn b() where (): Sized where (): Sized {} | ||
//~^ ERROR cannot define duplicate `where` clauses on an item | ||
|
||
enum C where (): Sized where (): Sized {} | ||
//~^ ERROR cannot define duplicate `where` clauses on an item | ||
|
||
struct D where (): Sized, where (): Sized {} | ||
//~^ ERROR cannot define duplicate `where` clauses on an item | ||
|
||
fn e() where (): Sized, where (): Sized {} | ||
//~^ ERROR cannot define duplicate `where` clauses on an item | ||
|
||
enum F where (): Sized, where (): Sized {} | ||
//~^ ERROR cannot define duplicate `where` clauses on an item | ||
|
||
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,80 @@ | ||
error: cannot define duplicate `where` clauses on an item | ||
--> $DIR/duplicate-where-clauses.rs:1:32 | ||
| | ||
LL | struct A where (): Sized where (): Sized {} | ||
| - ^ | ||
| | | ||
| previous `where` clause starts here | ||
| | ||
help: consider joining the two `where` clauses into one | ||
| | ||
LL | struct A where (): Sized, (): Sized {} | ||
| ~ | ||
|
||
error: cannot define duplicate `where` clauses on an item | ||
--> $DIR/duplicate-where-clauses.rs:4:30 | ||
| | ||
LL | fn b() where (): Sized where (): Sized {} | ||
| - ^ | ||
| | | ||
| previous `where` clause starts here | ||
| | ||
help: consider joining the two `where` clauses into one | ||
| | ||
LL | fn b() where (): Sized, (): Sized {} | ||
| ~ | ||
|
||
error: cannot define duplicate `where` clauses on an item | ||
--> $DIR/duplicate-where-clauses.rs:7:30 | ||
| | ||
LL | enum C where (): Sized where (): Sized {} | ||
| - ^ | ||
| | | ||
| previous `where` clause starts here | ||
| | ||
help: consider joining the two `where` clauses into one | ||
| | ||
LL | enum C where (): Sized, (): Sized {} | ||
| ~ | ||
|
||
error: cannot define duplicate `where` clauses on an item | ||
--> $DIR/duplicate-where-clauses.rs:10:33 | ||
| | ||
LL | struct D where (): Sized, where (): Sized {} | ||
| - ^ | ||
| | | ||
| previous `where` clause starts here | ||
| | ||
help: consider joining the two `where` clauses into one | ||
| | ||
LL | struct D where (): Sized, (): Sized {} | ||
| ~ | ||
|
||
error: cannot define duplicate `where` clauses on an item | ||
--> $DIR/duplicate-where-clauses.rs:13:31 | ||
| | ||
LL | fn e() where (): Sized, where (): Sized {} | ||
| - ^ | ||
| | | ||
| previous `where` clause starts here | ||
| | ||
help: consider joining the two `where` clauses into one | ||
| | ||
LL | fn e() where (): Sized, (): Sized {} | ||
| ~ | ||
|
||
error: cannot define duplicate `where` clauses on an item | ||
--> $DIR/duplicate-where-clauses.rs:16:31 | ||
| | ||
LL | enum F where (): Sized, where (): Sized {} | ||
| - ^ | ||
| | | ||
| previous `where` clause starts here | ||
| | ||
help: consider joining the two `where` clauses into one | ||
| | ||
LL | enum F where (): Sized, (): Sized {} | ||
| ~ | ||
|
||
error: aborting due to 6 previous errors | ||
|