This commit is contained in:
king6cong 2017-02-13 18:41:45 +08:00
parent 81bd2675ea
commit 8443c1e3b0

View File

@ -1213,7 +1213,7 @@ fn extend_with_element(&mut self, n: usize, value: T) {
unsafe { unsafe {
let mut ptr = self.as_mut_ptr().offset(self.len() as isize); let mut ptr = self.as_mut_ptr().offset(self.len() as isize);
// Use SetLenOnDrop to work around bug where compiler // Use SetLenOnDrop to work around bug where compiler
// may not realize the store through `ptr` trough self.set_len() // may not realize the store through `ptr` through self.set_len()
// don't alias. // don't alias.
let mut local_len = SetLenOnDrop::new(&mut self.len); let mut local_len = SetLenOnDrop::new(&mut self.len);