Skip to content

Commit b979225

Browse files
---
yaml --- r: 59930 b: refs/heads/master c: 02889f7 h: refs/heads/master v: v3
1 parent f2f77df commit b979225

File tree

4 files changed

+8
-18
lines changed

4 files changed

+8
-18
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: 984180c600b083b272237c0b343bb3e3dd844086
2+
refs/heads/master: 02889f75072cd3eb75afc4000d15b8174eda6155
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 2d28d645422c1617be58c8ca7ad9a457264ca850
55
refs/heads/try: c50a9d5b664478e533ba1d1d353213d70c8ad589

trunk/src/libcore/prelude.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ pub use io::{print, println};
3131
/* Reexported types and traits */
3232

3333
pub use clone::Clone;
34-
pub use cmp::{Eq, Ord, TotalEq, TotalOrd, Ordering, Less, Equal, Greater};
34+
pub use cmp::{Eq, Ord, TotalEq, TotalOrd, Ordering, Less, Equal, Greater, Equiv};
3535
pub use container::{Container, Mutable, Map, Set};
3636
pub use hash::Hash;
3737
pub use old_iter::{BaseIter, ReverseIter, MutableIter, ExtendedIter, EqIter};

trunk/src/librustc/middle/ty.rs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2499,15 +2499,12 @@ pub fn type_is_enum(ty: t) -> bool {
24992499
// constructors
25002500
pub fn type_is_c_like_enum(cx: ctxt, ty: t) -> bool {
25012501
match get(ty).sty {
2502-
ty_enum(did, _) => {
2503-
let variants = enum_variants(cx, did);
2504-
if variants.len() == 0 {
2505-
false
2506-
} else {
2507-
variants.all(|v| v.args.len() == 0)
2508-
}
2509-
}
2510-
_ => false
2502+
ty_enum(did, _) => {
2503+
let variants = enum_variants(cx, did);
2504+
let some_n_ary = vec::any(*variants, |v| vec::len(v.args) > 0u);
2505+
return !some_n_ary;
2506+
}
2507+
_ => return false
25112508
}
25122509
}
25132510

trunk/src/test/compile-fail/uninhabited-enum-cast.rs

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)