summaryrefslogtreecommitdiffstats
path: root/src/test/ui/suggestions/derive-clone-for-eq.fixed
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/suggestions/derive-clone-for-eq.fixed')
-rw-r--r--src/test/ui/suggestions/derive-clone-for-eq.fixed18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/test/ui/suggestions/derive-clone-for-eq.fixed b/src/test/ui/suggestions/derive-clone-for-eq.fixed
new file mode 100644
index 000000000..f07784d53
--- /dev/null
+++ b/src/test/ui/suggestions/derive-clone-for-eq.fixed
@@ -0,0 +1,18 @@
+// run-rustfix
+// https://github.com/rust-lang/rust/issues/79076
+
+use std::cmp::PartialEq;
+
+#[derive(Clone, Eq)] //~ ERROR [E0277]
+pub struct Struct<T: std::clone::Clone>(T);
+
+impl<T: Clone, U> PartialEq<U> for Struct<T>
+where
+ U: Into<Struct<T>> + Clone
+{
+ fn eq(&self, _other: &U) -> bool {
+ todo!()
+ }
+}
+
+fn main() {}