Error code E0777

A literal value was used inside #[derive].

Erroneous code example:

#[derive("Clone")] // error!
struct Foo;
Run

Only paths to traits are allowed as argument inside #[derive]. You can find more information about the #[derive] attribute in the Rust Book.

#[derive(Clone)] // ok!
struct Foo;
Run

Back to list of error codes