-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Description
Issue by kballard
Sunday May 18, 2014 at 00:05 GMT
For earlier discussion, see rust-lang/rust#14268
This issue was labelled with: in the Rust repository
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.