@@ -488,7 +488,7 @@ pub fn specialize(cx: @MatchCheckCtxt,
488488 match cx.tcx.def_map.find(&pat_id) {
489489 Some(&def_variant(_, id)) => {
490490 if variant(id) == *ctor_id {
491- Some(vec::from_slice (r.tail()))
491+ Some(vec::to_owned (r.tail()))
492492 } else {
493493 None
494494 }
@@ -507,7 +507,7 @@ pub fn specialize(cx: @MatchCheckCtxt,
507507 _ => fail!(~" type error")
508508 };
509509 if match_ {
510- Some(vec::from_slice (r.tail()))
510+ Some(vec::to_owned (r.tail()))
511511 } else {
512512 None
513513 }
@@ -538,7 +538,7 @@ pub fn specialize(cx: @MatchCheckCtxt,
538538 _ => fail!(~" type error")
539539 };
540540 if match_ {
541- Some(vec::from_slice (r.tail()))
541+ Some(vec::to_owned (r.tail()))
542542 } else {
543543 None
544544 }
@@ -548,7 +548,7 @@ pub fn specialize(cx: @MatchCheckCtxt,
548548 Some(args) => args,
549549 None => vec::from_elem(arity, wild())
550550 };
551- Some(vec::append(args, vec::from_slice (r.tail())))
551+ Some(vec::append(args, vec::to_owned (r.tail())))
552552 }
553553 def_variant(_, _) => None,
554554
@@ -560,7 +560,7 @@ pub fn specialize(cx: @MatchCheckCtxt,
560560 Some(args) => new_args = args,
561561 None => new_args = vec::from_elem(arity, wild())
562562 }
563- Some(vec::append(new_args, vec::from_slice (r.tail())))
563+ Some(vec::append(new_args, vec::to_owned (r.tail())))
564564 }
565565 _ => None
566566 }
@@ -578,7 +578,7 @@ pub fn specialize(cx: @MatchCheckCtxt,
578578 _ => wild()
579579 }
580580 });
581- Some(vec::append(args, vec::from_slice (r.tail())))
581+ Some(vec::append(args, vec::to_owned (r.tail())))
582582 } else {
583583 None
584584 }
@@ -608,7 +608,7 @@ pub fn specialize(cx: @MatchCheckCtxt,
608608 _ => wild()
609609 }
610610 });
611- Some(vec::append(args, vec::from_slice (r.tail())))
611+ Some(vec::append(args, vec::to_owned (r.tail())))
612612 }
613613 }
614614 }
@@ -627,21 +627,21 @@ pub fn specialize(cx: @MatchCheckCtxt,
627627 single => true,
628628 _ => fail!(~" type error")
629629 };
630- if match_ { Some(vec::from_slice (r.tail())) } else { None }
630+ if match_ { Some(vec::to_owned (r.tail())) } else { None }
631631 }
632632 pat_range(lo, hi) => {
633633 let (c_lo, c_hi) = match *ctor_id {
634634 val(ref v) => ((/*bad*/copy *v), (/*bad*/copy *v)),
635635 range(ref lo, ref hi) =>
636636 ((/*bad*/copy *lo), (/*bad*/copy *hi)),
637- single => return Some(vec::from_slice (r.tail())),
637+ single => return Some(vec::to_owned (r.tail())),
638638 _ => fail!(~" type error")
639639 };
640640 let v_lo = eval_const_expr(cx.tcx, lo),
641641 v_hi = eval_const_expr(cx.tcx, hi);
642642 let match_ = compare_const_vals(&c_lo, &v_lo) >= 0 &&
643643 compare_const_vals(&c_hi, &v_hi) <= 0;
644- if match_ { Some(vec::from_slice (r.tail())) } else { None }
644+ if match_ { Some(vec::to_owned (r.tail())) } else { None }
645645 }
646646 pat_vec(before, slice, after) => {
647647 match *ctor_id {
@@ -674,7 +674,7 @@ pub fn specialize(cx: @MatchCheckCtxt,
674674}
675675
676676pub fn default(cx: @MatchCheckCtxt, r: &[@pat]) -> Option<~[@pat]> {
677- if is_wild(cx, r[0]) { Some(vec::from_slice (r.tail())) }
677+ if is_wild(cx, r[0]) { Some(vec::to_owned (r.tail())) }
678678 else { None }
679679}
680680
0 commit comments