]> git.lizzy.rs Git - rust.git/blob - tests/ui/const-generics/defaults/doesnt_infer.rs
Rollup merge of #106726 - cmorin6:fix-comment-typos, r=Nilstrieb
[rust.git] / tests / ui / const-generics / defaults / doesnt_infer.rs
1 // test that defaulted const params are not used to help type inference
2
3 struct Foo<const N: u32 = 2>;
4
5 impl<const N: u32> Foo<N> {
6     fn foo() -> Self { loop {} }
7 }
8
9 fn main() {
10     let foo = Foo::<1>::foo();
11     let foo = Foo::foo();
12     //~^ error: type annotations needed for `Foo<N>`
13 }