Skip to content

Commit 7071bbf

Browse files
---
yaml --- r: 58715 b: refs/heads/try c: 02889f7 h: refs/heads/master i: 58713: eaa2a47 58711: 7ab1f7a v: v3
1 parent 91c37b2 commit 7071bbf

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
@@ -2,7 +2,7 @@
22
refs/heads/master: c081ffbd1e845687202a975ea2e698b623e5722f
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 213f7b24ccd9a6833af7e1a329c5e7ffc8f9e3d2
5-
refs/heads/try: 984180c600b083b272237c0b343bb3e3dd844086
5+
refs/heads/try: 02889f75072cd3eb75afc4000d15b8174eda6155
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/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};

branches/try/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

branches/try/src/test/compile-fail/uninhabited-enum-cast.rs

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

0 commit comments

Comments
 (0)