diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2018-02-21 16:29:45 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-02-21 16:29:45 +0100 |
| commit | 2a32060fb6251b5226da9785f81390151720c6bb (patch) | |
| tree | f91984947b6253231f444c06e3a545974c447c2a | |
| parent | 27a046e9338fb0455c33b13e8fe28da78212dedc (diff) | |
| parent | 96157ef8422298e66bcbf7dc1b2b28dd6d90b745 (diff) | |
| download | rust-2a32060fb6251b5226da9785f81390151720c6bb.tar.gz rust-2a32060fb6251b5226da9785f81390151720c6bb.zip | |
Rollup merge of #47379 - da-x:master, r=sfackler
Derive std::cmp::Reverse as Copy or Clone If the type parameter is Copy or Clone, then `Reverse` should be too.
| -rw-r--r-- | src/libcore/cmp.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libcore/cmp.rs b/src/libcore/cmp.rs index 266cae3c122..e6759d1bad9 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<T>(#[stable(feature = "reverse_cmp_key", since = "1.19.0")] pub T); |
