Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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