@@ -488,7 +488,7 @@ pub fn specialize(cx: @MatchCheckCtxt,
488
488
match cx.tcx.def_map.find(&pat_id) {
489
489
Some(&def_variant(_, id)) => {
490
490
if variant(id) == *ctor_id {
491
- Some(vec::from_slice (r.tail()))
491
+ Some(vec::to_owned (r.tail()))
492
492
} else {
493
493
None
494
494
}
@@ -507,7 +507,7 @@ pub fn specialize(cx: @MatchCheckCtxt,
507
507
_ => fail!(~" type error")
508
508
};
509
509
if match_ {
510
- Some(vec::from_slice (r.tail()))
510
+ Some(vec::to_owned (r.tail()))
511
511
} else {
512
512
None
513
513
}
@@ -538,7 +538,7 @@ pub fn specialize(cx: @MatchCheckCtxt,
538
538
_ => fail!(~" type error")
539
539
};
540
540
if match_ {
541
- Some(vec::from_slice (r.tail()))
541
+ Some(vec::to_owned (r.tail()))
542
542
} else {
543
543
None
544
544
}
@@ -548,7 +548,7 @@ pub fn specialize(cx: @MatchCheckCtxt,
548
548
Some(args) => args,
549
549
None => vec::from_elem(arity, wild())
550
550
};
551
- Some(vec::append(args, vec::from_slice (r.tail())))
551
+ Some(vec::append(args, vec::to_owned (r.tail())))
552
552
}
553
553
def_variant(_, _) => None,
554
554
@@ -560,7 +560,7 @@ pub fn specialize(cx: @MatchCheckCtxt,
560
560
Some(args) => new_args = args,
561
561
None => new_args = vec::from_elem(arity, wild())
562
562
}
563
- Some(vec::append(new_args, vec::from_slice (r.tail())))
563
+ Some(vec::append(new_args, vec::to_owned (r.tail())))
564
564
}
565
565
_ => None
566
566
}
@@ -578,7 +578,7 @@ pub fn specialize(cx: @MatchCheckCtxt,
578
578
_ => wild()
579
579
}
580
580
});
581
- Some(vec::append(args, vec::from_slice (r.tail())))
581
+ Some(vec::append(args, vec::to_owned (r.tail())))
582
582
} else {
583
583
None
584
584
}
@@ -608,7 +608,7 @@ pub fn specialize(cx: @MatchCheckCtxt,
608
608
_ => wild()
609
609
}
610
610
});
611
- Some(vec::append(args, vec::from_slice (r.tail())))
611
+ Some(vec::append(args, vec::to_owned (r.tail())))
612
612
}
613
613
}
614
614
}
@@ -627,21 +627,21 @@ pub fn specialize(cx: @MatchCheckCtxt,
627
627
single => true,
628
628
_ => fail!(~" type error")
629
629
};
630
- if match_ { Some(vec::from_slice (r.tail())) } else { None }
630
+ if match_ { Some(vec::to_owned (r.tail())) } else { None }
631
631
}
632
632
pat_range(lo, hi) => {
633
633
let (c_lo, c_hi) = match *ctor_id {
634
634
val(ref v) => ((/*bad*/copy *v), (/*bad*/copy *v)),
635
635
range(ref lo, ref hi) =>
636
636
((/*bad*/copy *lo), (/*bad*/copy *hi)),
637
- single => return Some(vec::from_slice (r.tail())),
637
+ single => return Some(vec::to_owned (r.tail())),
638
638
_ => fail!(~" type error")
639
639
};
640
640
let v_lo = eval_const_expr(cx.tcx, lo),
641
641
v_hi = eval_const_expr(cx.tcx, hi);
642
642
let match_ = compare_const_vals(&c_lo, &v_lo) >= 0 &&
643
643
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 }
645
645
}
646
646
pat_vec(before, slice, after) => {
647
647
match *ctor_id {
@@ -674,7 +674,7 @@ pub fn specialize(cx: @MatchCheckCtxt,
674
674
}
675
675
676
676
pub 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())) }
678
678
else { None }
679
679
}
680
680
0 commit comments