Skip to content

Commit ebc3de2

Browse files
committed
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.
1 parent 115121d commit ebc3de2

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

src/librustc/middle/traits/select.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1663,11 +1663,11 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
16631663
}
16641664

16651665
ty::ty_vec(element_ty, ref len) => {
1666-
// [T, ..n] and [T]
1666+
// [T; n] and [T]
16671667
match bound {
16681668
ty::BoundCopy => {
16691669
match *len {
1670-
// [T, ..n] is copy iff T is copy
1670+
// [T; n] is copy iff T is copy
16711671
Some(_) => ok_if(vec![element_ty]),
16721672

16731673
// [T] is unsized and hence affine

src/librustc_typeck/check/coercion.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,8 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> {
234234
}
235235

236236

237-
// &[T, ..n] or &mut [T, ..n] -> &[T]
238-
// or &mut [T, ..n] -> &mut [T]
237+
// &[T; n] or &mut [T; n] -> &[T]
238+
// or &mut [T; n] -> &mut [T]
239239
// or &Concrete -> &Trait, etc.
240240
fn coerce_unsized(&self,
241241
source: Ty<'tcx>,

src/librustc_typeck/check/method/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ into a more explicit UFCS form:
1818
Here `ADJ` is some kind of adjustment, which is typically a series of
1919
autoderefs and then possibly an autoref (e.g., `&**receiver`). However
2020
we sometimes do other adjustments and coercions along the way, in
21-
particular unsizing (e.g., converting from `[T, ..n]` to `[T]`).
21+
particular unsizing (e.g., converting from `[T; n]` to `[T]`).
2222

2323
## The Two Phases
2424

src/librustc_typeck/check/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2085,7 +2085,7 @@ fn lookup_indexing<'a, 'tcx>(fcx: &FnCtxt<'a, 'tcx>,
20852085
return final_mt;
20862086
}
20872087

2088-
// After we have fully autoderef'd, if the resulting type is [T, ..n], then
2088+
// After we have fully autoderef'd, if the resulting type is [T; n], then
20892089
// do a final unsized coercion to yield [T].
20902090
if let ty::ty_vec(element_ty, Some(_)) = ty.sty {
20912091
let adjusted_ty = ty::mk_vec(fcx.tcx(), element_ty, None);

0 commit comments

Comments
 (0)