rust/tests/ui/const-generics/issues/issue-67739.rs

19 lines
438 B
Rust
Raw Normal View History

// revisions: full min
#![cfg_attr(full, feature(generic_const_exprs))]
#![cfg_attr(full, allow(incomplete_features))]
2020-03-12 19:04:14 -05:00
use std::mem;
pub trait Trait {
type Associated: Sized;
fn associated_size(&self) -> usize {
[0u8; mem::size_of::<Self::Associated>()];
//[min]~^ ERROR constant expression depends on a generic parameter
//[full]~^^ ERROR unconstrained generic constant
2020-03-12 19:04:14 -05:00
0
}
}
fn main() {}