-
Notifications
You must be signed in to change notification settings - Fork 18
Closed
Description
Hello.
I have the code:
enum Things { A, B, C };
enum sumtype {
one = 0,
two = 1
};
struct Baz {
int x;
int y;
//Things things<>; // if uncomment then works
sumtype *e;
};Error is:
#[derive( Copy , Clone , Debug , Eq , PartialEq )] pub enum sumtype { one = 0isize , two = 1isize , }
11 | #[derive( Copy , Clone , Debug , Eq , PartialEq )] pub struct Baz { pub x : i32 , pub y : i32 , pub e : Option < Box < sumtype >> , }
| ^^^^ --------------------------------- this field does not implement `Copy`If uncomment //Things things<>; then it is ok (Copy attribute has gone from Baz):
#[derive( Copy , Clone , Debug , Eq , PartialEq )] pub enum sumtype { one = 0isize , two = 1isize , }
#[derive( Clone , Debug , Eq , PartialEq )] pub struct Baz { pub x : i32 , pub y : i32 , pub thing : Vec < Things > , pub e : Option < Box < sumtype >> , }Metadata
Metadata
Assignees
Labels
No labels