I am new to Rust. I've found this code in Rust's compiler.
#[must_use]
pub struct IeeeFloat<S> {
/// Absolute significand value (including the integer bit).
sig: [Limb; 1],
/// The signed unbiased exponent of the value.
exp: ExpInt,
/// What kind of floating point number this is.
category: Category,
/// Sign bit of the number.
sign: bool,
marker: PhantomData<S>,
}
Then they did
impl<S> Copy for IeeeFloat<S> {}
impl<S> Clone for IeeeFloat<S> {
fn clone(&self) -> Self {
*self
}
}
My question is, isn't this same as #[derive(Copy, Clone)]? Why do they explicitly write impl Copy for IEEE? And isn't this clone implementation the same as the clone in std? Why would you redefine it
Link is here