You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
tock-registers: fix Copy and Clone implementation on Field
A Field contains a PhantomData over a generic R: RegisterLongName, and
a PhantomData<R> is copyable regardless of whether R: Copy. However,
using #[derive(Copy, Clone)] will generate
#[automatically_derived]
#[allow(unused_qualifications)]
impl<T: ::core::marker::Copy + IntLike,
R: ::core::marker::Copy + RegisterLongName>
::core::marker::Copy for Field<T, R> {}
and hence Field will only implement Copy when R: Copy.
Manually implementing Clone and Copy works around this issue.
See rust-lang/rust#26925 for more
information on this.
Signed-off-by: Leon Schuermann <[email protected]>
0 commit comments