Fix merge "failures"
This commit is contained in:
parent
b05aae2d41
commit
606bd75586
2 changed files with 20 additions and 12 deletions
|
@ -4537,18 +4537,9 @@ pub fn each_bound_trait_and_supertraits(tcx: ctxt,
|
||||||
// list.
|
// list.
|
||||||
#[cfg(not(stage0))]
|
#[cfg(not(stage0))]
|
||||||
pub fn each_bound_trait_and_supertraits(tcx: ctxt,
|
pub fn each_bound_trait_and_supertraits(tcx: ctxt,
|
||||||
bounds: param_bounds,
|
bounds: &ParamBounds,
|
||||||
f: &fn(&TraitRef) -> bool) -> bool {
|
f: &fn(@TraitRef) -> bool) -> bool {
|
||||||
for bounds.each |bound| {
|
for bounds.trait_bounds.each |&bound_trait_ref| {
|
||||||
let bound_trait_ref = match *bound {
|
|
||||||
ty::bound_trait(bound_t) => bound_t,
|
|
||||||
|
|
||||||
ty::bound_copy | ty::bound_owned |
|
|
||||||
ty::bound_const | ty::bound_durable => {
|
|
||||||
loop; // skip non-trait bounds
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
let mut supertrait_set = HashMap::new();
|
let mut supertrait_set = HashMap::new();
|
||||||
let mut trait_refs = ~[];
|
let mut trait_refs = ~[];
|
||||||
let mut i = 0;
|
let mut i = 0;
|
||||||
|
|
|
@ -49,6 +49,7 @@ pub impl<E:CLike> EnumSet<E> {
|
||||||
(self.bits & bit(e)) != 0
|
(self.bits & bit(e)) != 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(stage0)]
|
||||||
fn each(&self, f: &fn(E) -> bool) {
|
fn each(&self, f: &fn(E) -> bool) {
|
||||||
let mut bits = self.bits;
|
let mut bits = self.bits;
|
||||||
let mut index = 0;
|
let mut index = 0;
|
||||||
|
@ -63,6 +64,22 @@ pub impl<E:CLike> EnumSet<E> {
|
||||||
bits >>= 1;
|
bits >>= 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#[cfg(not(stage0))]
|
||||||
|
fn each(&self, f: &fn(E) -> bool) -> bool {
|
||||||
|
let mut bits = self.bits;
|
||||||
|
let mut index = 0;
|
||||||
|
while bits != 0 {
|
||||||
|
if (bits & 1) != 0 {
|
||||||
|
let e = CLike::from_uint(index);
|
||||||
|
if !f(e) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
index += 1;
|
||||||
|
bits >>= 1;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<E:CLike> core::Sub<EnumSet<E>, EnumSet<E>> for EnumSet<E> {
|
impl<E:CLike> core::Sub<EnumSet<E>, EnumSet<E>> for EnumSet<E> {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue