]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-58022.rs
Rollup merge of #65613 - Mark-Simulacrum:rustdoc-preserve-ws, r=GuillaumeGomez
[rust.git] / src / test / ui / issues / issue-58022.rs
1 pub trait Foo: Sized {
2     const SIZE: usize;
3
4     fn new(slice: &[u8; Foo::SIZE]) -> Self;
5     //~^ ERROR: type annotations needed: cannot resolve `_: Foo`
6 }
7
8 pub struct Bar<T: ?Sized>(T);
9
10 impl Bar<[u8]> {
11     const SIZE: usize = 32;
12
13     fn new(slice: &[u8; Self::SIZE]) -> Self {
14         Foo(Box::new(*slice))
15         //~^ ERROR: expected function, tuple struct or tuple variant, found trait `Foo`
16     }
17 }
18
19 fn main() {}