2021-10-20 17:36:50 -05:00
|
|
|
// 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();
|
2022-02-14 07:13:02 -06:00
|
|
|
//~^ error: type annotations needed for `Foo<N>`
|
2021-10-20 17:36:50 -05:00
|
|
|
}
|