]> git.lizzy.rs Git - rust.git/blob - src/test/ui/const-generics/issues/issue-67739.rs
21d13de22ebfc7ac279cb0bb0ac4bcb84414eb98
[rust.git] / src / test / ui / const-generics / issues / issue-67739.rs
1 // revisions: full min
2 #![cfg_attr(full, feature(const_generics))]
3 #![cfg_attr(full, allow(incomplete_features))]
4 #![cfg_attr(min, feature(min_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         //[full]~^ ERROR constant expression depends on a generic parameter
14         //[min]~^^ ERROR generic parameters may not be used in const operations
15         0
16     }
17 }
18
19 fn main() {}