提交 ebc3de22 编写于 作者: M Marcel Müller

Fixed old occurences of the removed array syntax

As per RFC#520 the syntax for arrays has changed,
this changes the remaining comments to reflect
the new syntax.
上级 115121de
......@@ -1663,11 +1663,11 @@ fn builtin_bound(&mut self,
}
ty::ty_vec(element_ty, ref len) => {
// [T, ..n] and [T]
// [T; n] and [T]
match bound {
ty::BoundCopy => {
match *len {
// [T, ..n] is copy iff T is copy
// [T; n] is copy iff T is copy
Some(_) => ok_if(vec![element_ty]),
// [T] is unsized and hence affine
......
......@@ -234,8 +234,8 @@ fn coerce_borrowed_pointer(&self,
}
// &[T, ..n] or &mut [T, ..n] -> &[T]
// or &mut [T, ..n] -> &mut [T]
// &[T; n] or &mut [T; n] -> &[T]
// or &mut [T; n] -> &mut [T]
// or &Concrete -> &Trait, etc.
fn coerce_unsized(&self,
source: Ty<'tcx>,
......
......@@ -18,7 +18,7 @@ into a more explicit UFCS form:
Here `ADJ` is some kind of adjustment, which is typically a series of
autoderefs and then possibly an autoref (e.g., `&**receiver`). However
we sometimes do other adjustments and coercions along the way, in
particular unsizing (e.g., converting from `[T, ..n]` to `[T]`).
particular unsizing (e.g., converting from `[T; n]` to `[T]`).
## The Two Phases
......
......@@ -2085,7 +2085,7 @@ fn lookup_indexing<'a, 'tcx>(fcx: &FnCtxt<'a, 'tcx>,
return final_mt;
}
// After we have fully autoderef'd, if the resulting type is [T, ..n], then
// After we have fully autoderef'd, if the resulting type is [T; n], then
// do a final unsized coercion to yield [T].
if let ty::ty_vec(element_ty, Some(_)) = ty.sty {
let adjusted_ty = ty::mk_vec(fcx.tcx(), element_ty, None);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册