about summary refs log tree commit diff
path: root/src/libcollections/enum_set.rs
diff options
context:
space:
mode:
authorAndrew Paseltiner <apaseltiner@gmail.com>2015-03-13 13:47:55 -0400
committerAndrew Paseltiner <apaseltiner@gmail.com>2015-03-16 09:55:41 -0400
commit90f06ae33fdf34e60c29cbd38dd3ec7be6b3badb (patch)
treeed7416aa18a4af2fa2c752b32c643181aac4b469 /src/libcollections/enum_set.rs
parentee7696383f3423cdd17373ff9e75c01acd8e3417 (diff)
downloadrust-90f06ae33fdf34e60c29cbd38dd3ec7be6b3badb.tar.gz
rust-90f06ae33fdf34e60c29cbd38dd3ec7be6b3badb.zip
document undefined collection behavior with interior mutability
closes #23327
Diffstat (limited to 'src/libcollections/enum_set.rs')
-rw-r--r--src/libcollections/enum_set.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/libcollections/enum_set.rs b/src/libcollections/enum_set.rs
index 68ff94cfbfb..eec61cfcd56 100644
--- a/src/libcollections/enum_set.rs
+++ b/src/libcollections/enum_set.rs
@@ -24,6 +24,11 @@ use core::ops::{Sub, BitOr, BitAnd, BitXor};
 
 #[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
 /// A specialized set implementation to use enum types.
+///
+/// It is a logic error for an item to be modified in such a way that the transformation of the
+/// item to or from a `usize`, as determined by the `CLike` trait, changes while the item is in the
+/// set. This is normally only possible through `Cell`, `RefCell`, global state, I/O, or unsafe
+/// code.
 pub struct EnumSet<E> {
     // We must maintain the invariant that no bits are set
     // for which no variant exists