Struct vector field: the size for value of type `[u8]` cannot be known at compilation time

I am totally new to rust, and writing my first personal toy project. The problem:

struct Stack {
    items: Vec<Path>,
}

impl Stack {
    fn new() -> Stack {
        Stack { items: Vec::new() }
    }
}

The compiler says: "error[E0277]: the size for values of type [u8] cannot be known at compilation time"

and shows that:
items: Vec,
| ^^^^^^^^^ doesn't have a size known at compile-time

I don't know the reason behind it, is there anyone can help me figure it out?

Try to use Vec<PathBuf> instead.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.