From ebc3de22d8e3b7b1d6e2c77e444965bb9db51aa7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcel=20M=C3=BCller?= Date: Mon, 8 Jun 2015 17:58:08 +0200 Subject: [PATCH] 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. --- src/librustc/middle/traits/select.rs | 4 ++-- src/librustc_typeck/check/coercion.rs | 4 ++-- src/librustc_typeck/check/method/README.md | 2 +- src/librustc_typeck/check/mod.rs | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/librustc/middle/traits/select.rs b/src/librustc/middle/traits/select.rs index 4ea6f0cb26ea0..789d4f8b9d310 100644 --- a/src/librustc/middle/traits/select.rs +++ b/src/librustc/middle/traits/select.rs @@ -1663,11 +1663,11 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> { } 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 diff --git a/src/librustc_typeck/check/coercion.rs b/src/librustc_typeck/check/coercion.rs index 92317aae08967..624312dac3873 100644 --- a/src/librustc_typeck/check/coercion.rs +++ b/src/librustc_typeck/check/coercion.rs @@ -234,8 +234,8 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> { } - // &[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>, diff --git a/src/librustc_typeck/check/method/README.md b/src/librustc_typeck/check/method/README.md index 367273dc635f4..b5d317d602538 100644 --- a/src/librustc_typeck/check/method/README.md +++ b/src/librustc_typeck/check/method/README.md @@ -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 diff --git a/src/librustc_typeck/check/mod.rs b/src/librustc_typeck/check/mod.rs index e37856bbb2ea2..6f97239ae939e 100644 --- a/src/librustc_typeck/check/mod.rs +++ b/src/librustc_typeck/check/mod.rs @@ -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);