mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-01 03:03:40 +00:00
Add test for issue-67739
This commit is contained in:
parent
a2c41e9cdc
commit
3609bac340
18
src/test/ui/const-generics/issues/issue-67739.rs
Normal file
18
src/test/ui/const-generics/issues/issue-67739.rs
Normal file
@ -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() {}
|
8
src/test/ui/const-generics/issues/issue-67739.stderr
Normal file
8
src/test/ui/const-generics/issues/issue-67739.stderr
Normal file
@ -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
Block a user