Skip to content

Commit e2e58d2

Browse files
committed
---
yaml --- r: 187407 b: refs/heads/try c: 653ceee h: refs/heads/master i: 187405: 91087cf 187403: 8af4b0e 187399: 48f3973 187391: 56b3b57 v: v3
1 parent 87e7b37 commit e2e58d2

File tree

11 files changed

+34
-167
lines changed

11 files changed

+34
-167
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: a5214e4330e8186da7b1117119a7dccfc36a2e6b
5+
refs/heads/try: 653ceee3b3a777ea452e718835e0b27cf369906c
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
88
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/try/src/libcollections/btree/node.rs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1085,7 +1085,7 @@ impl<K, V> Node<K, V> {
10851085
vals: RawItems::from_slice(self.vals()),
10861086
edges: RawItems::from_slice(self.edges()),
10871087

1088-
ptr: Unique::new(*self.keys as *mut u8),
1088+
ptr: *self.keys as *mut u8,
10891089
capacity: self.capacity(),
10901090
is_leaf: self.is_leaf()
10911091
},
@@ -1354,14 +1354,11 @@ struct MoveTraversalImpl<K, V> {
13541354
edges: RawItems<Node<K, V>>,
13551355

13561356
// For deallocation when we are done iterating.
1357-
ptr: Unique<u8>,
1357+
ptr: *mut u8,
13581358
capacity: usize,
13591359
is_leaf: bool
13601360
}
13611361

1362-
unsafe impl<K: Sync, V: Sync> Sync for MoveTraversalImpl<K, V> {}
1363-
unsafe impl<K: Send, V: Send> Send for MoveTraversalImpl<K, V> {}
1364-
13651362
impl<K, V> TraversalImpl for MoveTraversalImpl<K, V> {
13661363
type Item = (K, V);
13671364
type Edge = Node<K, V>;
@@ -1404,7 +1401,7 @@ impl<K, V> Drop for MoveTraversalImpl<K, V> {
14041401

14051402
let (alignment, size) =
14061403
calculate_allocation_generic::<K, V>(self.capacity, self.is_leaf);
1407-
unsafe { heap::deallocate(*self.ptr, size, alignment) };
1404+
unsafe { heap::deallocate(self.ptr, size, alignment) };
14081405
}
14091406
}
14101407

@@ -1428,12 +1425,12 @@ pub enum TraversalItem<K, V, E> {
14281425
/// A traversal over a node's entries and edges
14291426
pub type Traversal<'a, K, V> = AbsTraversal<ElemsAndEdges<Zip<slice::Iter<'a, K>,
14301427
slice::Iter<'a, V>>,
1431-
slice::Iter<'a, Node<K, V>>>>;
1428+
slice::Iter<'a, Node<K, V>>>>;
14321429

14331430
/// A mutable traversal over a node's entries and edges
14341431
pub type MutTraversal<'a, K, V> = AbsTraversal<ElemsAndEdges<Zip<slice::Iter<'a, K>,
14351432
slice::IterMut<'a, V>>,
1436-
slice::IterMut<'a, Node<K, V>>>>;
1433+
slice::IterMut<'a, Node<K, V>>>>;
14371434

14381435
/// An owning traversal over a node's entries and edges
14391436
pub type MoveTraversal<K, V> = AbsTraversal<MoveTraversalImpl<K, V>>;

branches/try/src/libcollections/linked_list.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ struct Rawlink<T> {
5151
}
5252

5353
impl<T> Copy for Rawlink<T> {}
54-
unsafe impl<T:Send> Send for Rawlink<T> {}
55-
unsafe impl<T:Sync> Sync for Rawlink<T> {}
54+
unsafe impl<T:'static+Send> Send for Rawlink<T> {}
55+
unsafe impl<T:Send+Sync> Sync for Rawlink<T> {}
5656

5757
struct Node<T> {
5858
next: Link<T>,

branches/try/src/libcollections/vec.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1755,9 +1755,6 @@ pub struct Drain<'a, T:'a> {
17551755
marker: PhantomData<&'a T>,
17561756
}
17571757

1758-
unsafe impl<'a, T: Sync> Sync for Drain<'a, T> {}
1759-
unsafe impl<'a, T: Send> Send for Drain<'a, T> {}
1760-
17611758
#[stable(feature = "rust1", since = "1.0.0")]
17621759
impl<'a, T> Iterator for Drain<'a, T> {
17631760
type Item = T;

branches/try/src/libcollections/vec_deque.rs

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ 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;
2728
use core::mem;
2829
use core::num::{Int, UnsignedInt};
2930
use core::ops::{Index, IndexMut};
@@ -58,6 +59,12 @@ pub struct VecDeque<T> {
5859
ptr: Unique<T>,
5960
}
6061

62+
#[stable(feature = "rust1", since = "1.0.0")]
63+
unsafe impl<T: Send> Send for VecDeque<T> {}
64+
65+
#[stable(feature = "rust1", since = "1.0.0")]
66+
unsafe impl<T: Sync> Sync for VecDeque<T> {}
67+
6168
#[stable(feature = "rust1", since = "1.0.0")]
6269
impl<T: Clone> Clone for VecDeque<T> {
6370
fn clone(&self) -> VecDeque<T> {
@@ -538,7 +545,9 @@ impl<T> VecDeque<T> {
538545
IterMut {
539546
tail: self.tail,
540547
head: self.head,
541-
ring: unsafe { self.buffer_as_mut_slice() },
548+
cap: self.cap,
549+
ptr: *self.ptr,
550+
marker: marker::PhantomData,
542551
}
543552
}
544553

@@ -1506,12 +1515,17 @@ impl<'a, T> RandomAccessIterator for Iter<'a, T> {
15061515
}
15071516
}
15081517

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.
15091521
/// `VecDeque` mutable iterator.
15101522
#[stable(feature = "rust1", since = "1.0.0")]
15111523
pub struct IterMut<'a, T:'a> {
1512-
ring: &'a mut [T],
1524+
ptr: *mut T,
15131525
tail: usize,
15141526
head: usize,
1527+
cap: usize,
1528+
marker: marker::PhantomData<&'a mut T>,
15151529
}
15161530

15171531
#[stable(feature = "rust1", since = "1.0.0")]
@@ -1524,17 +1538,16 @@ impl<'a, T> Iterator for IterMut<'a, T> {
15241538
return None;
15251539
}
15261540
let tail = self.tail;
1527-
self.tail = wrap_index(self.tail + 1, self.ring.len());
1541+
self.tail = wrap_index(self.tail + 1, self.cap);
15281542

15291543
unsafe {
1530-
let elem = self.ring.get_unchecked_mut(tail);
1531-
Some(&mut *(elem as *mut _))
1544+
Some(&mut *self.ptr.offset(tail as isize))
15321545
}
15331546
}
15341547

15351548
#[inline]
15361549
fn size_hint(&self) -> (usize, Option<usize>) {
1537-
let len = count(self.tail, self.head, self.ring.len());
1550+
let len = count(self.tail, self.head, self.cap);
15381551
(len, Some(len))
15391552
}
15401553
}
@@ -1546,11 +1559,10 @@ impl<'a, T> DoubleEndedIterator for IterMut<'a, T> {
15461559
if self.tail == self.head {
15471560
return None;
15481561
}
1549-
self.head = wrap_index(self.head - 1, self.ring.len());
1562+
self.head = wrap_index(self.head - 1, self.cap);
15501563

15511564
unsafe {
1552-
let elem = self.ring.get_unchecked_mut(self.head);
1553-
Some(&mut *(elem as *mut _))
1565+
Some(&mut *self.ptr.offset(self.head as isize))
15541566
}
15551567
}
15561568
}

branches/try/src/libcore/iter.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ use num::{ToPrimitive, Int};
6868
use ops::{Add, Deref, FnMut};
6969
use option::Option;
7070
use option::Option::{Some, None};
71-
use marker::{Send, Sized, Sync};
71+
use marker::Sized;
7272
use usize;
7373

7474
/// An interface for dealing with "external iterators". These types of iterators
@@ -1786,10 +1786,6 @@ pub struct Peekable<I: Iterator> {
17861786
peeked: Option<I::Item>,
17871787
}
17881788

1789-
// FIXME: after #22828 being fixed, the following unsafe impl should be removed
1790-
unsafe impl<I: Iterator> Sync for Peekable<I> where I: Sync, I::Item: Sync {}
1791-
unsafe impl<I: Iterator> Send for Peekable<I> where I: Send, I::Item: Send {}
1792-
17931789
impl<I: Iterator + Clone> Clone for Peekable<I> where I::Item: Clone {
17941790
fn clone(&self) -> Peekable<I> {
17951791
Peekable {

branches/try/src/libcore/slice.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ use ptr;
5151
use ptr::PtrExt;
5252
use mem;
5353
use mem::size_of;
54-
use marker::{Send, Sized, Sync, self};
54+
use marker::{Sized, self};
5555
use raw::Repr;
5656
// Avoid conflicts with *both* the Slice trait (buggy) and the `slice::raw` module.
5757
use raw::Slice as RawSlice;
@@ -740,9 +740,6 @@ pub struct Iter<'a, T: 'a> {
740740
_marker: marker::PhantomData<&'a T>,
741741
}
742742

743-
unsafe impl<'a, T: Sync> Sync for Iter<'a, T> {}
744-
unsafe impl<'a, T: Sync> Send for Iter<'a, T> {}
745-
746743
#[unstable(feature = "core")]
747744
impl<'a, T> ops::Index<ops::Range<usize>> for Iter<'a, T> {
748745
type Output = [T];
@@ -833,8 +830,6 @@ pub struct IterMut<'a, T: 'a> {
833830
_marker: marker::PhantomData<&'a mut T>,
834831
}
835832

836-
unsafe impl<'a, T: Sync> Sync for IterMut<'a, T> {}
837-
unsafe impl<'a, T: Send> Send for IterMut<'a, T> {}
838833

839834
#[unstable(feature = "core")]
840835
impl<'a, T> ops::Index<ops::Range<usize>> for IterMut<'a, T> {

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/libstd/sys/unix/os.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,8 @@ pub fn current_exe() -> io::Result<PathBuf> {
229229
if v.is_null() {
230230
Err(io::Error::last_os_error())
231231
} else {
232-
Ok(Path::new(CStr::from_ptr(v).to_bytes().to_vec()))
232+
let vec = CStr::from_ptr(v).to_bytes().to_vec();
233+
Ok(PathBuf::new::<OsString>(&OsStringExt::from_vec(vec)))
233234
}
234235
}
235236
}

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),

branches/try/src/test/run-pass/sync-send-iterators-in-libcollections.rs

Lines changed: 0 additions & 98 deletions
This file was deleted.

0 commit comments

Comments
 (0)