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

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

15 lines
288 B
Rust
Raw Permalink Normal View History

2021-10-23 10:57:49 -05:00
#![feature(generic_const_exprs)]
2021-07-10 11:38:39 -05:00
#![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() {}