rust/tests/ui/const-generics/issues/issue-83249.rs
2023-01-11 09:32:08 +00:00

24 lines
322 B
Rust

#![allow(incomplete_features)]
#![feature(generic_const_exprs)]
trait Foo {
const N: usize;
}
impl Foo for u8 {
const N: usize = 1;
}
fn foo<T: Foo>(_: [u8; T::N]) -> T {
todo!()
}
pub fn bar() {
let _: u8 = foo([0; 1]);
let _ = foo([0; 1]);
//~^ ERROR type annotations needed
}
fn main() {}