File tree Expand file tree Collapse file tree 3 files changed +21
-13
lines changed Expand file tree Collapse file tree 3 files changed +21
-13
lines changed Original file line number Diff line number Diff line change 1
1
---
2
- refs/heads/master: b05aae2d4151a5985d58758fcd46037fb39a5fb9
2
+ refs/heads/master: 606bd75586419948f109de313ab37e31397ca7a3
3
3
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4
4
refs/heads/snap-stage3: 2d28d645422c1617be58c8ca7ad9a457264ca850
5
5
refs/heads/try: c50a9d5b664478e533ba1d1d353213d70c8ad589
Original file line number Diff line number Diff line change @@ -4537,18 +4537,9 @@ pub fn each_bound_trait_and_supertraits(tcx: ctxt,
4537
4537
// list.
4538
4538
#[cfg(not(stage0))]
4539
4539
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| {
4552
4543
let mut supertrait_set = HashMap::new();
4553
4544
let mut trait_refs = ~[];
4554
4545
let mut i = 0;
Original file line number Diff line number Diff line change @@ -49,6 +49,7 @@ pub impl<E:CLike> EnumSet<E> {
49
49
( self . bits & bit ( e) ) != 0
50
50
}
51
51
52
+ #[ cfg( stage0) ]
52
53
fn each ( & self , f : & fn ( E ) -> bool ) {
53
54
let mut bits = self . bits ;
54
55
let mut index = 0 ;
@@ -63,6 +64,22 @@ pub impl<E:CLike> EnumSet<E> {
63
64
bits >>= 1 ;
64
65
}
65
66
}
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
+ }
66
83
}
67
84
68
85
impl < E : CLike > core:: Sub < EnumSet < E > , EnumSet < E > > for EnumSet < E > {
You can’t perform that action at this time.
0 commit comments