From 96157ef8422298e66bcbf7dc1b2b28dd6d90b745 Mon Sep 17 00:00:00 2001 From: Dan Aloni Date: Fri, 12 Jan 2018 13:18:33 +0200 Subject: [PATCH] Derive std::cmp::Reverse as Copy or Clone If the type parameter is Copy or Clone, then `Reverse` should be too. --- src/libcore/cmp.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libcore/cmp.rs b/src/libcore/cmp.rs index 266cae3c122f4..e6759d1bad940 100644 --- a/src/libcore/cmp.rs +++ b/src/libcore/cmp.rs @@ -343,7 +343,7 @@ impl Ordering { /// v.sort_by_key(|&num| (num > 3, Reverse(num))); /// assert_eq!(v, vec![3, 2, 1, 6, 5, 4]); /// ``` -#[derive(PartialEq, Eq, Debug)] +#[derive(PartialEq, Eq, Debug, Copy, Clone)] #[stable(feature = "reverse_cmp_key", since = "1.19.0")] pub struct Reverse(#[stable(feature = "reverse_cmp_key", since = "1.19.0")] pub T);