Skip to content

Commit ed8707b

Browse files
committed
---
yaml --- r: 187404 b: refs/heads/try c: 101498c h: refs/heads/master v: v3
1 parent 8af4b0e commit ed8707b

File tree

4 files changed

+11
-50
lines changed

4 files changed

+11
-50
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: b4c965ee803a4521d8b4575f634e036f93e408f3
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 3a96d6a9818fe2affc98a187fb1065120458cee9
5-
refs/heads/try: 3a96d6a9818fe2affc98a187fb1065120458cee9
5+
refs/heads/try: 101498cd880431fc44401ffa73fd8936ebe84025
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
88
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/try/src/libcollections/vec_deque.rs

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ use core::cmp::Ordering;
2424
use core::default::Default;
2525
use core::fmt;
2626
use core::iter::{self, repeat, FromIterator, IntoIterator, RandomAccessIterator};
27-
use core::marker;
2827
use core::mem;
2928
use core::num::{Int, UnsignedInt};
3029
use core::ops::{Index, IndexMut};
@@ -545,9 +544,7 @@ impl<T> VecDeque<T> {
545544
IterMut {
546545
tail: self.tail,
547546
head: self.head,
548-
cap: self.cap,
549-
ptr: *self.ptr,
550-
marker: marker::PhantomData,
547+
ring: unsafe { self.buffer_as_mut_slice() },
551548
}
552549
}
553550

@@ -1515,17 +1512,12 @@ impl<'a, T> RandomAccessIterator for Iter<'a, T> {
15151512
}
15161513
}
15171514

1518-
// FIXME This was implemented differently from Iter because of a problem
1519-
// with returning the mutable reference. I couldn't find a way to
1520-
// make the lifetime checker happy so, but there should be a way.
15211515
/// `VecDeque` mutable iterator.
15221516
#[stable(feature = "rust1", since = "1.0.0")]
15231517
pub struct IterMut<'a, T:'a> {
1524-
ptr: *mut T,
1518+
ring: &'a mut [T],
15251519
tail: usize,
15261520
head: usize,
1527-
cap: usize,
1528-
marker: marker::PhantomData<&'a mut T>,
15291521
}
15301522

15311523
#[stable(feature = "rust1", since = "1.0.0")]
@@ -1538,16 +1530,17 @@ impl<'a, T> Iterator for IterMut<'a, T> {
15381530
return None;
15391531
}
15401532
let tail = self.tail;
1541-
self.tail = wrap_index(self.tail + 1, self.cap);
1533+
self.tail = wrap_index(self.tail + 1, self.ring.len());
15421534

15431535
unsafe {
1544-
Some(&mut *self.ptr.offset(tail as isize))
1536+
let elem = self.ring.get_unchecked_mut(tail);
1537+
Some(&mut *(elem as *mut _))
15451538
}
15461539
}
15471540

15481541
#[inline]
15491542
fn size_hint(&self) -> (usize, Option<usize>) {
1550-
let len = count(self.tail, self.head, self.cap);
1543+
let len = count(self.tail, self.head, self.ring.len());
15511544
(len, Some(len))
15521545
}
15531546
}
@@ -1559,10 +1552,11 @@ impl<'a, T> DoubleEndedIterator for IterMut<'a, T> {
15591552
if self.tail == self.head {
15601553
return None;
15611554
}
1562-
self.head = wrap_index(self.head - 1, self.cap);
1555+
self.head = wrap_index(self.head - 1, self.ring.len());
15631556

15641557
unsafe {
1565-
Some(&mut *self.ptr.offset(self.head as isize))
1558+
let elem = self.ring.get_unchecked_mut(self.head);
1559+
Some(&mut *(elem as *mut _))
15661560
}
15671561
}
15681562
}

branches/try/src/libstd/path.rs

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@
108108
use core::prelude::*;
109109

110110
use ascii::*;
111-
use borrow::{Borrow, IntoCow, ToOwned, Cow};
111+
use borrow::{Borrow, ToOwned, Cow};
112112
use cmp;
113113
use iter::{self, IntoIterator};
114114
use mem;
@@ -987,18 +987,6 @@ impl Borrow<Path> for PathBuf {
987987
}
988988
}
989989

990-
impl IntoCow<'static, Path> for PathBuf {
991-
fn into_cow(self) -> Cow<'static, Path> {
992-
Cow::Owned(self)
993-
}
994-
}
995-
996-
impl<'a> IntoCow<'a, Path> for &'a Path {
997-
fn into_cow(self) -> Cow<'a, Path> {
998-
Cow::Borrowed(self)
999-
}
1000-
}
1001-
1002990
impl ToOwned for Path {
1003991
type Owned = PathBuf;
1004992
fn to_owned(&self) -> PathBuf { self.to_path_buf() }
@@ -1423,26 +1411,6 @@ mod tests {
14231411
);
14241412
);
14251413

1426-
#[test]
1427-
fn into_cow() {
1428-
use borrow::{Cow, IntoCow};
1429-
1430-
let static_path = Path::new("/home/foo");
1431-
let static_cow_path: Cow<'static, Path> = static_path.into_cow();
1432-
let pathbuf = PathBuf::new("/home/foo");
1433-
1434-
{
1435-
let path: &Path = &pathbuf;
1436-
let borrowed_cow_path: Cow<Path> = path.into_cow();
1437-
1438-
assert_eq!(static_cow_path, borrowed_cow_path);
1439-
}
1440-
1441-
let owned_cow_path: Cow<'static, Path> = pathbuf.into_cow();
1442-
1443-
assert_eq!(static_cow_path, owned_cow_path);
1444-
}
1445-
14461414
#[test]
14471415
#[cfg(unix)]
14481416
pub fn test_decompositions_unix() {

branches/try/src/libsyntax/feature_gate.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,6 @@ pub static KNOWN_ATTRIBUTES: &'static [(&'static str, AttributeType)] = &[
187187
("no_link", Normal),
188188
("derive", Normal),
189189
("should_fail", Normal),
190-
("should_panic", Normal),
191190
("ignore", Normal),
192191
("no_implicit_prelude", Normal),
193192
("reexport_test_harness_main", Normal),

0 commit comments

Comments
 (0)