blob: 5874625adff61e1ca35d95416fae6af120f30b81 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
// check-pass
#![feature(generic_const_exprs)]
#![allow(incomplete_features)]
trait Foo<const N: usize> {
type Assoc: Default;
}
impl Foo<0> for () {
type Assoc = u32;
}
impl Foo<3> for () {
type Assoc = i64;
}
fn foo<T, const N: usize>(_: T) -> <() as Foo<{ N + 1 }>>::Assoc
where
(): Foo<{ N + 1 }>,
{
Default::default()
}
fn main() {
let mut _q = Default::default();
_q = foo::<_, 2>(_q);
}
|