Skip to content

Commit 9ee58cf

Browse files
committed
---
yaml --- r: 65514 b: refs/heads/master c: 64759c9 h: refs/heads/master v: v3
1 parent f543716 commit 9ee58cf

File tree

3 files changed

+11
-22
lines changed

3 files changed

+11
-22
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: c5d7a77a533d33a4681f629744f0d0695c5e08b7
2+
refs/heads/master: 64759c9f25993d255c7ced4edecdd14a75e149b0
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 18e3db7392d2d0697b7e27d6d986139960144d85
55
refs/heads/try: 7b78b52e602bb3ea8174f9b2006bff3315f03ef9

trunk/src/librustc/middle/trans/expr.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -727,8 +727,14 @@ fn trans_def_dps_unadjusted(bcx: block, ref_expr: @ast::expr,
727727
}
728728
}
729729
ast::def_struct(*) => {
730-
// Nothing to do here.
731-
// FIXME #6572: May not be true in the case of classes with destructors.
730+
let ty = expr_ty(bcx, ref_expr);
731+
match ty::get(ty).sty {
732+
ty::ty_struct(did, _) if ty::has_dtor(ccx.tcx, did) => {
733+
let repr = adt::represent_type(ccx, ty);
734+
adt::trans_start_init(bcx, repr, lldest, 0);
735+
}
736+
_ => {}
737+
}
732738
return bcx;
733739
}
734740
_ => {

trunk/src/libstd/vec.rs

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1532,7 +1532,7 @@ pub fn each<'r,T>(v: &'r [T], f: &fn(&'r T) -> bool) -> bool {
15321532
}
15331533
broke = n > 0;
15341534
}
1535-
return !broke;
1535+
return true;
15361536
}
15371537

15381538
/// Like `each()`, but for the case where you have
@@ -1554,7 +1554,7 @@ pub fn each_mut<'r,T>(v: &'r mut [T], f: &fn(elem: &'r mut T) -> bool) -> bool {
15541554
}
15551555
broke = n > 0;
15561556
}
1557-
return !broke;
1557+
return broke;
15581558
}
15591559

15601560
/// Like `each()`, but for the case where you have a vector that *may or may
@@ -3566,23 +3566,6 @@ mod tests {
35663566
}
35673567
}
35683568

3569-
#[test]
3570-
fn test_each_ret_len0() {
3571-
let mut a0 : [int, .. 0] = [];
3572-
assert_eq!(each(a0, |_p| fail!()), true);
3573-
assert_eq!(each_mut(a0, |_p| fail!()), true);
3574-
}
3575-
3576-
#[test]
3577-
fn test_each_ret_len1() {
3578-
let mut a1 = [17];
3579-
assert_eq!(each(a1, |_p| true), true);
3580-
assert_eq!(each_mut(a1, |_p| true), true);
3581-
assert_eq!(each(a1, |_p| false), false);
3582-
assert_eq!(each_mut(a1, |_p| false), false);
3583-
}
3584-
3585-
35863569
#[test]
35873570
fn test_each_permutation() {
35883571
let mut results: ~[~[int]];

0 commit comments

Comments
 (0)