mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 17:24:06 +00:00
14 lines
292 B
Rust
14 lines
292 B
Rust
// 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<N>`
|
|
}
|