Files
rust/tests/ui/unsized-locals/reference-unsized-locals.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

6 lines
211 B
Rust
Raw Normal View History

fn main() {
let foo: Box<[u8]> = Box::new(*b"foo");
2025-06-13 01:16:36 +02:00
let foo: [u8] = *foo; //~ERROR the size for values of type `[u8]` cannot be known at compilation time [E0277]
assert_eq!(&foo, b"foo" as &[u8]);
}