rust/tests/ui/const-generics/defaults/complex-generic-default-expr.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

13 lines
428 B
Rust
Raw Normal View History

//@ revisions: full min
//@[full] check-pass
#![cfg_attr(full, feature(generic_const_exprs))]
2021-10-23 10:57:49 -05:00
#![cfg_attr(full, allow(incomplete_features))]
2021-04-18 06:57:22 -05:00
struct Foo<const N: usize, const M: usize = { N + 1 }>;
//[min]~^ ERROR generic parameters may not be used in const operations
2021-04-18 06:57:22 -05:00
struct Bar<T, const TYPE_SIZE: usize = { std::mem::size_of::<T>() }>(T);
//[min]~^ ERROR generic parameters may not be used in const operations
2021-04-18 06:57:22 -05:00
fn main() {}