Skip to content

Commit 3609bac

Browse files
committed
Add test for issue-67739
1 parent a2c41e9 commit 3609bac

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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() {}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
error: array lengths can't depend on generic parameters
2+
--> $DIR/issue-67739.rs:12:15
3+
|
4+
LL | [0u8; mem::size_of::<Self::Associated>()];
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6+
7+
error: aborting due to previous error
8+

0 commit comments

Comments
 (0)