rust/tests/ui/const-generics/infer/uninferred-consts.rs
2024-06-19 04:41:56 +00:00

13 lines
339 B
Rust

// Test that we emit an error if we cannot properly infer a constant.
// taken from https://github.com/rust-lang/rust/issues/70507#issuecomment-615268893
struct Foo;
impl Foo {
fn foo<const A: usize, const B: usize>(self) {}
}
fn main() {
Foo.foo();
//~^ ERROR type annotations needed
//~| ERROR type annotations needed
}