Skip to content

Commit e43ac06

Browse files
committed
---
yaml --- r: 140683 b: refs/heads/try2 c: 606bd75 h: refs/heads/master i: 140681: 9801ab6 140679: 0ecb0b6 v: v3
1 parent 3bb26a0 commit e43ac06

File tree

3 files changed

+21
-13
lines changed

3 files changed

+21
-13
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: b05aae2d4151a5985d58758fcd46037fb39a5fb9
8+
refs/heads/try2: 606bd75586419948f109de313ab37e31397ca7a3
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/librustc/middle/ty.rs

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4537,18 +4537,9 @@ pub fn each_bound_trait_and_supertraits(tcx: ctxt,
45374537
// list.
45384538
#[cfg(not(stage0))]
45394539
pub fn each_bound_trait_and_supertraits(tcx: ctxt,
4540-
bounds: param_bounds,
4541-
f: &fn(&TraitRef) -> bool) -> bool {
4542-
for bounds.each |bound| {
4543-
let bound_trait_ref = match *bound {
4544-
ty::bound_trait(bound_t) => bound_t,
4545-
4546-
ty::bound_copy | ty::bound_owned |
4547-
ty::bound_const | ty::bound_durable => {
4548-
loop; // skip non-trait bounds
4549-
}
4550-
};
4551-
4540+
bounds: &ParamBounds,
4541+
f: &fn(@TraitRef) -> bool) -> bool {
4542+
for bounds.trait_bounds.each |&bound_trait_ref| {
45524543
let mut supertrait_set = HashMap::new();
45534544
let mut trait_refs = ~[];
45544545
let mut i = 0;

branches/try2/src/librustc/util/enum_set.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ pub impl<E:CLike> EnumSet<E> {
4949
(self.bits & bit(e)) != 0
5050
}
5151

52+
#[cfg(stage0)]
5253
fn each(&self, f: &fn(E) -> bool) {
5354
let mut bits = self.bits;
5455
let mut index = 0;
@@ -63,6 +64,22 @@ pub impl<E:CLike> EnumSet<E> {
6364
bits >>= 1;
6465
}
6566
}
67+
#[cfg(not(stage0))]
68+
fn each(&self, f: &fn(E) -> bool) -> bool {
69+
let mut bits = self.bits;
70+
let mut index = 0;
71+
while bits != 0 {
72+
if (bits & 1) != 0 {
73+
let e = CLike::from_uint(index);
74+
if !f(e) {
75+
return false;
76+
}
77+
}
78+
index += 1;
79+
bits >>= 1;
80+
}
81+
return true;
82+
}
6683
}
6784

6885
impl<E:CLike> core::Sub<EnumSet<E>, EnumSet<E>> for EnumSet<E> {

0 commit comments

Comments
 (0)