-
Notifications
You must be signed in to change notification settings - Fork 13.9k
Closed
Description
Marker fields are used to provide extra information about types, including opting out of Copy, Send, and Share bounds. However, the presence of a marker field can prevent the ability to #[derive] traits for that type. For example, core::kinds::marker::NoCopy only implements Clone and Eq (according to rustdoc; I am unsure if there are any libstd traits it implements because rustdoc doesn't show cross-crate traits). This means that any struct with a NoCopy field cannot e.g. derive Show, or Ord, or other useful traits.
I think the right solution here is to simply not consider the marker fields when deriving traits, with the only exception being Clone. Every other trait should just pretend that field doesn't exist.
Metadata
Metadata
Assignees
Labels
No labels