Add test for issue-67739
This commit is contained in:
parent
a2c41e9cdc
commit
3609bac340
|
@ -0,0 +1,18 @@
|
||||||
|
// Regression test for #67739
|
||||||
|
|
||||||
|
#![allow(incomplete_features)]
|
||||||
|
#![feature(const_generics)]
|
||||||
|
|
||||||
|
use std::mem;
|
||||||
|
|
||||||
|
pub trait Trait {
|
||||||
|
type Associated: Sized;
|
||||||
|
|
||||||
|
fn associated_size(&self) -> usize {
|
||||||
|
[0u8; mem::size_of::<Self::Associated>()];
|
||||||
|
//~^ ERROR: array lengths can't depend on generic parameters
|
||||||
|
0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn main() {}
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue