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.
This commit is contained in:
Guillaume Gomez 2018-02-21 16:29:45 +01:00 committed by GitHub
commit 2a32060fb6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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);