Add warning about varying hashes/orderings

This commit is contained in:
Sean Leffler 2017-01-17 13:56:46 -08:00 committed by GitHub
parent 6365c4307a
commit b08ab1e20d
1 changed files with 4 additions and 0 deletions

View File

@ -338,6 +338,10 @@ impl Any+Send {
///
/// A `TypeId` is currently only available for types which ascribe to `'static`,
/// but this limitation may be removed in the future.
///
/// While `TypeId` implements `Hash`, `PartialOrd`, and `Ord`, it is worth
/// noting that the hashes and ordering will vary between Rust releases. Beware
/// of relying on them outside of your code!
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Debug, Hash)]
#[stable(feature = "rust1", since = "1.0.0")]
pub struct TypeId {