]> git.lizzy.rs Git - rust.git/blob - tests/ui/const-generics/defaults/complex-generic-default-expr.rs
Rollup merge of #106144 - tgross35:patch-1, r=Mark-Simulacrum
[rust.git] / tests / ui / const-generics / defaults / complex-generic-default-expr.rs
1 // revisions: full min
2 //[full] check-pass
3 #![cfg_attr(full, feature(generic_const_exprs))]
4 #![cfg_attr(full, allow(incomplete_features))]
5
6 struct Foo<const N: usize, const M: usize = { N + 1 }>;
7 //[min]~^ ERROR generic parameters may not be used in const operations
8
9 struct Bar<T, const TYPE_SIZE: usize = { std::mem::size_of::<T>() }>(T);
10 //[min]~^ ERROR generic parameters may not be used in const operations
11
12 fn main() {}