Hmm, in case you’re trying to understand and/or resolve a particular compiler error it might help if you shared the error message.
Regarding the term “unsized” Rust has so-called “unsized types” (or “dynamically sized types”, DSTs) of which the slice type
[u8] (or more generally
[T]) is an example. At a first approximation, such types don’t exist at all but are just a trick to use the
&-symbol in things like slice types like
&[u8] or trait object types such as e.g.
&dyn Any. More precisely, unsized types can only exist behind a reference, which includes
&, but also
Arc<> for example. Something like
Box<dyn Error> is a common example using a different pointer type (in this case
Box<[u8]> is also possible.
In the case of a slice
&[u8], the reference-type
&[u8] consists of a pointer to some data which can belong for example to an array as in your case, or to a
Vec, etc, plus—additionally—the length of the slice. So
&[u8] internally is like a pair
(*const u8, usize) of a pointer and a length. This makes the
&[u8] references twice as large as ordinary references; for this reason these are also called “fat pointers”. Then there are coercions in place that can create slices like
&[u8] from other reference types such as
&[u8; 42] or
&Vec<u8>. These coercions are build-in for arrays, or reslized through the
Deref trait and based on unsafe API such as
slice::from_raw_parts, like is the case for
Oh, and by the way, the term “array” in Rust always refers to types
[T; N] of known, fixed length.