mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 17:24:06 +00:00
15 lines
288 B
Rust
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() {}
|