diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/issues/issue-58022.rs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/test/ui/issues/issue-58022.rs b/src/test/ui/issues/issue-58022.rs new file mode 100644 index 000000000..2a8a1eaa6 --- /dev/null +++ b/src/test/ui/issues/issue-58022.rs @@ -0,0 +1,19 @@ +pub trait Foo: Sized { + const SIZE: usize; + + fn new(slice: &[u8; Foo::SIZE]) -> Self; + //~^ ERROR: E0790 +} + +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() {} |