Skip to content

Commit edfd6d5

Browse files
committed
test
1 parent 25ec827 commit edfd6d5

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// run-pass
2+
#![feature(generic_const_exprs)]
3+
#![allow(incomplete_features)]
4+
5+
trait Foo<const N: usize> {
6+
type Assoc: Default;
7+
}
8+
9+
impl Foo<0> for () {
10+
type Assoc = u32;
11+
}
12+
13+
impl Foo<3> for () {
14+
type Assoc = i64;
15+
}
16+
17+
fn foo<T, const N: usize>(_: T) -> <() as Foo<{ N + 1 }>>::Assoc
18+
where
19+
(): Foo<{ N + 1 }>,
20+
{
21+
Default::default()
22+
}
23+
24+
fn main() {
25+
// Test that we can correctly infer `T` which requires evaluating
26+
// `{ N + 1 }` which has substs containing an inference var
27+
let mut _q = Default::default();
28+
_q = foo::<_, 2>(_q);
29+
}

0 commit comments

Comments
 (0)