-
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.
Auto merge of #79697 - rylev:clearer-const-diagnostic, r=oli-obk
A slightly clearer diagnostic when misusing const Fixes #79598 This produces the following diagnostic: "expected one of `>`, a const expression, lifetime, or type, found keyword `const`" Instead of the previous, more confusing: "expected one of `>`, const, lifetime, or type, found keyword `const`" This might not be completely clear as some users might not understand what a const expression is, but I do believe this is an improvement.
- Loading branch information
Showing
15 changed files
with
25 additions
and
25 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 |
---|---|---|
@@ -1,8 +1,8 @@ | ||
error: expected one of `>`, const, lifetime, or type, found `,` | ||
error: expected one of `>`, a const expression, lifetime, or type, found `,` | ||
--> $DIR/issue-20616-3.rs:13:24 | ||
| | ||
LL | type Type_3<T> = Box<T,,>; | ||
| ^ expected one of `>`, const, lifetime, or type | ||
| ^ expected one of `>`, a const expression, lifetime, or type | ||
|
||
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
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,8 +1,8 @@ | ||
error: expected one of `>`, const, lifetime, or type, found `,` | ||
error: expected one of `>`, a const expression, lifetime, or type, found `,` | ||
--> $DIR/issue-20616-4.rs:16:34 | ||
| | ||
LL | type Type_4<T> = Type_1_<'static,, T>; | ||
| ^ expected one of `>`, const, lifetime, or type | ||
| ^ expected one of `>`, a const expression, lifetime, or type | ||
|
||
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
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,8 +1,8 @@ | ||
error: expected one of `>`, const, lifetime, or type, found `,` | ||
error: expected one of `>`, a const expression, lifetime, or type, found `,` | ||
--> $DIR/issue-20616-5.rs:22:34 | ||
| | ||
LL | type Type_5<'a> = Type_1_<'a, (),,>; | ||
| ^ expected one of `>`, const, lifetime, or type | ||
| ^ expected one of `>`, a const expression, lifetime, or type | ||
|
||
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
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,8 +1,8 @@ | ||
error: expected one of `>`, const, lifetime, or type, found `,` | ||
error: expected one of `>`, a const expression, lifetime, or type, found `,` | ||
--> $DIR/issue-20616-6.rs:25:26 | ||
| | ||
LL | type Type_6 = Type_5_<'a,,>; | ||
| ^ expected one of `>`, const, lifetime, or type | ||
| ^ expected one of `>`, a const expression, lifetime, or type | ||
|
||
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
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,8 +1,8 @@ | ||
error: expected one of `>`, const, lifetime, or type, found `,` | ||
error: expected one of `>`, a const expression, lifetime, or type, found `,` | ||
--> $DIR/issue-20616-7.rs:28:22 | ||
| | ||
LL | type Type_7 = Box<(),,>; | ||
| ^ expected one of `>`, const, lifetime, or type | ||
| ^ expected one of `>`, a const expression, lifetime, or type | ||
|
||
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
type mut_box = Box<mut isize>; | ||
//~^ ERROR expected one of `>`, const, lifetime, or type, found keyword `mut` | ||
//~^ ERROR expected one of `>`, a const expression, lifetime, or type, found keyword `mut` |
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,8 +1,8 @@ | ||
error: expected one of `>`, const, lifetime, or type, found keyword `mut` | ||
error: expected one of `>`, a const expression, lifetime, or type, found keyword `mut` | ||
--> $DIR/removed-syntax-uniq-mut-ty.rs:1:20 | ||
| | ||
LL | type mut_box = Box<mut isize>; | ||
| ^^^ expected one of `>`, const, lifetime, or type | ||
| ^^^ expected one of `>`, a const expression, lifetime, or type | ||
|
||
error: aborting due to previous error | ||
|