forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
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#85800 - BoxyUwU:const-param-default-diagnos…
…tics, r=oli-obk Fix some diagnostic issues with const_generics_defaults feature gate This PR makes a few changes: - print out const param defaults in "lifetime ordering" errors rather than discarding them - update `is_simple_text` to account for const params when checking if a type has no generics, this was causing a note to be failed to add to an error message - fixes some diagnostic wording that incorrectly said there was ordering restrictions between type/const params despite the `const_generics_defaults` feature gate is active
- Loading branch information
Showing
8 changed files
with
47 additions
and
16 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
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/const-generics/defaults/param-order-err-pretty-prints-default.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,5 @@ | ||
#![feature(const_generics_defaults)] | ||
struct Foo<const M: usize = 10, 'a>(&'a u32); | ||
//~^ Error lifetime parameters must be declared prior to const parameters | ||
|
||
fn main() {} |
8 changes: 8 additions & 0 deletions
8
src/test/ui/const-generics/defaults/param-order-err-pretty-prints-default.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,8 @@ | ||
error: lifetime parameters must be declared prior to const parameters | ||
--> $DIR/param-order-err-pretty-prints-default.rs:2:33 | ||
| | ||
LL | struct Foo<const M: usize = 10, 'a>(&'a u32); | ||
| ----------------------^^- help: reorder the parameters: lifetimes, then consts and types: `<'a, const M: usize = 10>` | ||
|
||
error: aborting due to previous error | ||
|