diff options
| author | bors <bors@rust-lang.org> | 2018-10-04 11:39:50 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2018-10-04 11:39:50 +0000 |
| commit | 5472b0718f286266ab89acdf234c3552de7e973c (patch) | |
| tree | b458942ff0b20b422c1b3d9f288308ddd9d2e1bb /src/liballoc | |
| parent | 8a0e5cbf124cea5254bb09111cae6af1b86b21e4 (diff) | |
| parent | 71aded852f42fa05d95f31e549b289eea591533c (diff) | |
| download | rust-5472b0718f286266ab89acdf234c3552de7e973c.tar.gz rust-5472b0718f286266ab89acdf234c3552de7e973c.zip | |
Auto merge of #54809 - pietroalbini:rollup, r=pietroalbini
Rollup of 10 pull requests Successful merges: - #53523 (Add doc for impl From for Std Error) - #54746 (simplify some unused lints code) - #54761 (Make spec_extend use for_each()) - #54769 (Fix typo in CONTRIBUTING.md) - #54773 (Update a FIXME in memory.rs) - #54777 (abolish ICE when pretty-printing async block) - #54780 (Remove duplicate predicates in `explicit_predicates_of`) - #54788 (A handful of cleanups for rustc/mir) - #54789 (Introduce `TyKind::UnnormalizedProjection`) - #54795 (remove padding from multiline format string label) Failed merges: r? @ghost
Diffstat (limited to 'src/liballoc')
| -rw-r--r-- | src/liballoc/vec.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/liballoc/vec.rs b/src/liballoc/vec.rs index e845438c0a8..2bc037e3fee 100644 --- a/src/liballoc/vec.rs +++ b/src/liballoc/vec.rs @@ -1822,12 +1822,12 @@ impl<T, I> SpecExtend<T, I> for Vec<T> unsafe { let mut ptr = self.as_mut_ptr().add(self.len()); let mut local_len = SetLenOnDrop::new(&mut self.len); - for element in iterator { + iterator.for_each(move |element| { ptr::write(ptr, element); ptr = ptr.offset(1); // NB can't overflow since we would have had to alloc the address space local_len.increment_len(1); - } + }); } } else { self.extend_desugared(iterator) |
