blob: c7f14e47a9d64980ef15cb85691919c84e3862fd (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
#![feature(const_generics_defaults)]
// test that defaulted const params are not used to help type inference
struct Foo<const N: u32 = 2>;
impl<const N: u32> Foo<N> {
fn foo() -> Self { loop {} }
}
fn main() {
let foo = Foo::<1>::foo();
let foo = Foo::foo();
//~^ error: type annotations needed for `Foo<{_: u32}>`
}
|