`#[derive(Clone)]` is broken
use std::sync::Arc;
struct NoClone;
#[derive(Clone)]
struct WrapArc<T>(Arc<T>);
fn main() {
let foo = WrapArc(Arc::new(NoClone));
let foo_ = foo.clone();
}
Do you think this code should compile?
What about the following code:
struct AlwaysEq<T>(T);
impl<T> PartialEq for AlwaysEq<T> {
fn eq(&self, _other: &Self) -> bool {
true
}
}
impl<T> Eq for AlwaysEq<T> {}
struct NotEq;
#[derive(PartialEq, Eq)]
struct WrapAlwaysEq<T>(AlwaysEq<T>);
fn assert_is_eq(_: impl Eq) {}
fn main() {
let x = WrapAlwaysE...
Read more at rgbcu.be