Don't abort early when collecting const generics
This commit is contained in:
parent
2a1b6c52d3
commit
425fb58cac
5 changed files with 19 additions and 4 deletions
|
|
@ -8,6 +8,7 @@ fn foo<const X: (), T>(_: T) {
|
|||
|
||||
fn bar<const X: (), 'a>(_: &'a ()) {
|
||||
//~^ ERROR lifetime parameters must be declared prior to const parameters
|
||||
//~^^ ERROR const generics in any position are currently unsupported
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
|
|
|
|||
|
|
@ -22,5 +22,11 @@ error: const generics in any position are currently unsupported
|
|||
LL | fn foo<const X: (), T>(_: T) {
|
||||
| ^
|
||||
|
||||
error: aborting due to 3 previous errors
|
||||
error: const generics in any position are currently unsupported
|
||||
--> $DIR/const-param-before-other-params.rs:9:14
|
||||
|
|
||||
LL | fn bar<const X: (), 'a>(_: &'a ()) {
|
||||
| ^
|
||||
|
||||
error: aborting due to 4 previous errors
|
||||
|
||||
|
|
|
|||
|
|
@ -2,5 +2,6 @@ fn foo<const X: ()>() {} //~ ERROR const generics are unstable
|
|||
//~^ const generics in any position are currently unsupported
|
||||
|
||||
struct Foo<const X: usize>([(); X]); //~ ERROR const generics are unstable
|
||||
//~^ const generics in any position are currently unsupported
|
||||
|
||||
fn main() {}
|
||||
|
|
|
|||
|
|
@ -20,6 +20,12 @@ error: const generics in any position are currently unsupported
|
|||
LL | fn foo<const X: ()>() {} //~ ERROR const generics are unstable
|
||||
| ^
|
||||
|
||||
error: aborting due to 3 previous errors
|
||||
error: const generics in any position are currently unsupported
|
||||
--> $DIR/feature-gate-const_generics.rs:4:18
|
||||
|
|
||||
LL | struct Foo<const X: usize>([(); X]); //~ ERROR const generics are unstable
|
||||
| ^
|
||||
|
||||
error: aborting due to 4 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0658`.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue