Skip to content

Commit 88c743d

Browse files
committed
auto merge of #19007 : huonw/rust/more-marker-impls, r=alexcrichton
Useful for #[deriving].
2 parents 0047dbe + f975243 commit 88c743d

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/libcore/kinds.rs

+10-10
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ pub mod marker {
132132
/// (for example, `S<&'static int>` is a subtype of `S<&'a int>`
133133
/// for some lifetime `'a`, but not the other way around).
134134
#[lang="covariant_type"]
135-
#[deriving(PartialEq,Clone)]
135+
#[deriving(Clone, PartialEq, Eq, PartialOrd, Ord)]
136136
pub struct CovariantType<T>;
137137

138138
/// A marker type whose type parameter `T` is considered to be
@@ -175,7 +175,7 @@ pub mod marker {
175175
/// function requires arguments of type `T`, it must also accept
176176
/// arguments of type `U`, hence such a conversion is safe.
177177
#[lang="contravariant_type"]
178-
#[deriving(PartialEq,Clone)]
178+
#[deriving(Clone, PartialEq, Eq, PartialOrd, Ord)]
179179
pub struct ContravariantType<T>;
180180

181181
/// A marker type whose type parameter `T` is considered to be
@@ -200,7 +200,7 @@ pub mod marker {
200200
/// never written, but in fact `Cell` uses unsafe code to achieve
201201
/// interior mutability.
202202
#[lang="invariant_type"]
203-
#[deriving(PartialEq,Clone)]
203+
#[deriving(Clone, PartialEq, Eq, PartialOrd, Ord)]
204204
pub struct InvariantType<T>;
205205

206206
/// As `CovariantType`, but for lifetime parameters. Using
@@ -220,7 +220,7 @@ pub mod marker {
220220
/// For more information about variance, refer to this Wikipedia
221221
/// article <http://en.wikipedia.org/wiki/Variance_%28computer_science%29>.
222222
#[lang="covariant_lifetime"]
223-
#[deriving(PartialEq,Clone)]
223+
#[deriving(Clone, PartialEq, Eq, PartialOrd, Ord)]
224224
pub struct CovariantLifetime<'a>;
225225

226226
/// As `ContravariantType`, but for lifetime parameters. Using
@@ -236,7 +236,7 @@ pub mod marker {
236236
/// For more information about variance, refer to this Wikipedia
237237
/// article <http://en.wikipedia.org/wiki/Variance_%28computer_science%29>.
238238
#[lang="contravariant_lifetime"]
239-
#[deriving(PartialEq,Clone)]
239+
#[deriving(Clone, PartialEq, Eq, PartialOrd, Ord)]
240240
pub struct ContravariantLifetime<'a>;
241241

242242
/// As `InvariantType`, but for lifetime parameters. Using
@@ -247,34 +247,34 @@ pub mod marker {
247247
/// and this pointer is itself stored in an inherently mutable
248248
/// location (such as a `Cell`).
249249
#[lang="invariant_lifetime"]
250-
#[deriving(PartialEq,Clone)]
250+
#[deriving(Clone, PartialEq, Eq, PartialOrd, Ord)]
251251
pub struct InvariantLifetime<'a>;
252252

253253
/// A type which is considered "not sendable", meaning that it cannot
254254
/// be safely sent between tasks, even if it is owned. This is
255255
/// typically embedded in other types, such as `Gc`, to ensure that
256256
/// their instances remain thread-local.
257257
#[lang="no_send_bound"]
258-
#[deriving(PartialEq,Clone)]
258+
#[deriving(Clone, PartialEq, Eq, PartialOrd, Ord)]
259259
pub struct NoSend;
260260

261261
/// A type which is considered "not POD", meaning that it is not
262262
/// implicitly copyable. This is typically embedded in other types to
263263
/// ensure that they are never copied, even if they lack a destructor.
264264
#[lang="no_copy_bound"]
265-
#[deriving(PartialEq,Clone)]
265+
#[deriving(Clone, PartialEq, Eq, PartialOrd, Ord)]
266266
pub struct NoCopy;
267267

268268
/// A type which is considered "not sync", meaning that
269269
/// its contents are not threadsafe, hence they cannot be
270270
/// shared between tasks.
271271
#[lang="no_sync_bound"]
272-
#[deriving(PartialEq,Clone)]
272+
#[deriving(Clone, PartialEq, Eq, PartialOrd, Ord)]
273273
pub struct NoSync;
274274

275275
/// A type which is considered managed by the GC. This is typically
276276
/// embedded in other types.
277277
#[lang="managed_bound"]
278-
#[deriving(PartialEq,Clone)]
278+
#[deriving(Clone, PartialEq, Eq, PartialOrd, Ord)]
279279
pub struct Managed;
280280
}

0 commit comments

Comments
 (0)