We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a2c41e9 commit 3609bacCopy full SHA for 3609bac
src/test/ui/const-generics/issues/issue-67739.rs
@@ -0,0 +1,18 @@
1
+// Regression test for #67739
2
+
3
+#![allow(incomplete_features)]
4
+#![feature(const_generics)]
5
6
+use std::mem;
7
8
+pub trait Trait {
9
+ type Associated: Sized;
10
11
+ fn associated_size(&self) -> usize {
12
+ [0u8; mem::size_of::<Self::Associated>()];
13
+ //~^ ERROR: array lengths can't depend on generic parameters
14
+ 0
15
+ }
16
+}
17
18
+fn main() {}
src/test/ui/const-generics/issues/issue-67739.stderr
@@ -0,0 +1,8 @@
+error: array lengths can't depend on generic parameters
+ --> $DIR/issue-67739.rs:12:15
+ |
+LL | [0u8; mem::size_of::<Self::Associated>()];
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+error: aborting due to previous error
0 commit comments