Skip to content

Commit d17c0a6

Browse files
Jakub Wieczorekgraydon
authored andcommitted
---
yaml --- r: 38069 b: refs/heads/try c: 856dbac h: refs/heads/master i: 38067: 5375db8 v: v3
1 parent 8e692a8 commit d17c0a6

File tree

2 files changed

+7
-18
lines changed

2 files changed

+7
-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: 09bb07bed9166105ea961a42b5fff7739ae0d2e9
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: eb8fd119c65c67f3b1b8268cc7341c22d39b7b61
5-
refs/heads/try: 1968cb315af9d128ee4457738fddd1eba275277f
5+
refs/heads/try: 856dbac56726e34a010d2a74d5e19ef5c3e2ede3
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: a810c03263670238bccd64cabb12a23a46e3a278

branches/try/src/librustc/middle/check_alt.rs

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,7 @@ enum ctor {
173173
variant(def_id),
174174
val(const_val),
175175
range(const_val, const_val),
176-
vec(uint),
177-
vec_with_tail(uint)
176+
vec(uint)
178177
}
179178

180179
impl ctor : cmp::Eq {
@@ -189,11 +188,8 @@ impl ctor : cmp::Eq {
189188
(*cv0_self) == (*cv0_other) && (*cv1_self) == (*cv1_other)
190189
}
191190
(vec(n_self), vec(n_other)) => n_self == n_other,
192-
(vec_with_tail(n_self), vec_with_tail(n_other)) => {
193-
n_self == n_other
194-
}
195191
(single, _) | (variant(_), _) | (val(_), _) |
196-
(range(*), _) | (vec(*), _) | (vec_with_tail(*), _) => {
192+
(range(*), _) | (vec(*), _) => {
197193
false
198194
}
199195
}
@@ -328,7 +324,7 @@ fn pat_ctor_id(cx: @AltCheckCtxt, p: @pat) -> Option<ctor> {
328324
}
329325
pat_vec(elems, tail) => {
330326
match tail {
331-
Some(_) => Some(vec_with_tail(elems.len())),
327+
Some(_) => None,
332328
None => Some(vec(elems.len()))
333329
}
334330
}
@@ -465,7 +461,7 @@ fn ctor_arity(cx: @AltCheckCtxt, ctor: ctor, ty: ty::t) -> uint {
465461
ty::ty_struct(cid, _) => ty::lookup_struct_fields(cx.tcx, cid).len(),
466462
ty::ty_unboxed_vec(*) | ty::ty_evec(*) => {
467463
match ctor {
468-
vec(n) | vec_with_tail(n) => n,
464+
vec(n) => n,
469465
_ => 0u
470466
}
471467
}
@@ -614,19 +610,12 @@ fn specialize(cx: @AltCheckCtxt, r: ~[@pat], ctor_id: ctor, arity: uint,
614610
}
615611
pat_vec(elems, tail) => {
616612
match ctor_id {
617-
vec_with_tail(_) => {
618-
if elems.len() >= arity {
619-
Some(vec::append(elems.slice(0, arity), vec::tail(r)))
620-
} else {
621-
None
622-
}
623-
}
624613
vec(_) => {
625614
if elems.len() < arity && tail.is_some() {
626615
Some(vec::append(
627616
vec::append(elems, vec::from_elem(
628-
arity - elems.len(), wild())
629-
),
617+
arity - elems.len(), wild()
618+
)),
630619
vec::tail(r)
631620
))
632621
} else if elems.len() == arity {

0 commit comments

Comments
 (0)