Skip to content

Commit 17276a6

Browse files
---
yaml --- r: 58044 b: refs/heads/auto c: 02889f7 h: refs/heads/master v: v3
1 parent 7ace383 commit 17276a6

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
@@ -14,6 +14,6 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1414
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1515
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1616
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
17-
refs/heads/auto: 984180c600b083b272237c0b343bb3e3dd844086
17+
refs/heads/auto: 02889f75072cd3eb75afc4000d15b8174eda6155
1818
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1919
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c

branches/auto/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/auto/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/auto/src/test/compile-fail/uninhabited-enum-cast.rs

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

0 commit comments

Comments
 (0)