rust/src/test/ui/issues/issue-58022.rs
2019-12-10 12:02:18 -08:00

20 lines
399 B
Rust

pub trait Foo: Sized {
const SIZE: usize;
fn new(slice: &[u8; Foo::SIZE]) -> Self;
//~^ ERROR: type annotations needed
}
pub struct Bar<T: ?Sized>(T);
impl Bar<[u8]> {
const SIZE: usize = 32;
fn new(slice: &[u8; Self::SIZE]) -> Self {
Foo(Box::new(*slice))
//~^ ERROR: expected function, tuple struct or tuple variant, found trait `Foo`
}
}
fn main() {}