diff options
| author | Sebastian Dröge <sebastian@centricular.com> | 2018-01-03 12:26:55 +0200 |
|---|---|---|
| committer | Sebastian Dröge <sebastian@centricular.com> | 2018-01-03 15:05:18 +0200 |
| commit | 3f29e2b495a6b875af835f1fff64256e2d58d2b6 (patch) | |
| tree | d1d072c3c4e5f9c326719895a4840c100a1a589b | |
| parent | a56a3fc85f466c8488dccdfb78cfcd05740e0b36 (diff) | |
| download | rust-3f29e2b495a6b875af835f1fff64256e2d58d2b6.tar.gz rust-3f29e2b495a6b875af835f1fff64256e2d58d2b6.zip | |
Fix compilation of TrustedRandomAccess impl for slice::Chunks
https://github.com/rust-lang/rust/pull/47113 renamed the private size field to chunk_size for consistency.
| -rw-r--r-- | src/libcore/slice/mod.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libcore/slice/mod.rs b/src/libcore/slice/mod.rs index ebb16605931..9b8334167f5 100644 --- a/src/libcore/slice/mod.rs +++ b/src/libcore/slice/mod.rs @@ -2239,8 +2239,8 @@ impl<'a, T> FusedIterator for Chunks<'a, T> {} #[doc(hidden)] unsafe impl<'a, T> TrustedRandomAccess for Chunks<'a, T> { unsafe fn get_unchecked(&mut self, i: usize) -> &'a [T] { - let start = i * self.size; - let end = cmp::min(start + self.size, self.v.len()); + let start = i * self.chunk_size; + let end = cmp::min(start + self.chunk_size, self.v.len()); from_raw_parts(self.v.as_ptr().offset(start as isize), end - start) } fn may_have_side_effect() -> bool { false } |
