about summary refs log tree commit diff
path: root/tests/ui/const-generics/defaults/doesnt_infer.rs
blob: f62088210fed77620672ce759914d761e9136c9c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// 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<_>`
    //~| ERROR type annotations needed
}