diff --git a/library/alloc/src/vec.rs b/library/alloc/src/vec.rs index 8526f15288fa4..4cad873190f6b 100644 --- a/library/alloc/src/vec.rs +++ b/library/alloc/src/vec.rs @@ -2956,6 +2956,11 @@ impl Iterator for IntoIter { if mem::size_of::() == 0 { mem::zeroed() } else { ptr::read(self.ptr.add(i)) } } } + + #[inline] + fn last(mut self) -> Option { + self.next_back() + } } #[stable(feature = "rust1", since = "1.0.0")]