diff --git a/src/libcollections/enum_set.rs b/src/libcollections/enum_set.rs index 454d4f1ca872324b5e4dbc9c87d38d73edcadb46..77eee98ecd8d925310f3ade01851b682993832a2 100644 --- a/src/libcollections/enum_set.rs +++ b/src/libcollections/enum_set.rs @@ -100,7 +100,7 @@ pub fn is_superset(&self, other: &EnumSet) -> bool { /// Returns `true` if this `EnumSet` is included in the given `EnumSet`. #[unstable = "matches collection reform specification, waiting for dust to settle"] pub fn is_subset(&self, other: &EnumSet) -> bool { - other.is_subset(self) + other.is_superset(self) } /// Returns the union of both `EnumSets`. @@ -302,8 +302,13 @@ fn test_superset() { e2.insert(A); e2.insert(B); - assert!(!e1.is_superset(&e2)); + let mut e3: EnumSet = EnumSet::new(); + e3.insert(C); + + assert!(e1.is_subset(&e2)); assert!(e2.is_superset(&e1)); + assert!(!e3.is_superset(&e2)) + assert!(!e2.is_superset(&e3)) } #[test]