Skip to content

Commit

Permalink
Add regression test for rust-lang#69414
Browse files Browse the repository at this point in the history
Closes rust-lang#69414 (no longer ICEs after rust-lang#74159)
  • Loading branch information
Alexendoo committed Jul 17, 2020
1 parent c2dbebd commit f7979d3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// compile-flags: -Zsave-analysis
// Regression test for #69414 ^

use std::marker::PhantomData;

struct B<T, const N: T>(PhantomData<[T; N]>); //~ ERROR const generics are unstable
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
error[E0770]: the type of const parameters must not depend on other generic parameters
--> $DIR/const-param-type-depends-on-type-param-ungated.rs:3:22
--> $DIR/const-param-type-depends-on-type-param-ungated.rs:6:22
|
LL | struct B<T, const N: T>(PhantomData<[T; N]>);
| ^ the type must not depend on the parameter `T`

error[E0658]: const generics are unstable
--> $DIR/const-param-type-depends-on-type-param-ungated.rs:3:19
--> $DIR/const-param-type-depends-on-type-param-ungated.rs:6:19
|
LL | struct B<T, const N: T>(PhantomData<[T; N]>);
| ^
Expand Down

0 comments on commit f7979d3

Please sign in to comment.