rust/tests/ui/const-generics/defaults/generic-expr-default-concrete.rs
2023-01-11 09:32:08 +00:00

15 lines
288 B
Rust

#![feature(generic_const_exprs)]
#![allow(incomplete_features)]
struct Foo<const N: usize, const M: usize = { N + 1 }>;
fn no_constraining() -> Foo<10> {
Foo::<10, 11>
}
pub fn different_than_default() -> Foo<10> {
Foo::<10, 12>
//~^ error: mismatched types
}
fn main() {}