Skip to content

Commit 9ad351e

Browse files
committed
---
yaml --- r: 166582 b: refs/heads/snap-stage3 c: 4804841 h: refs/heads/master v: v3
1 parent 41892d5 commit 9ad351e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+841
-1398
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 18842f89f084c52588fe7cffe07f87bf6e90796a
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 19f73b4ef6fb1d24f19738a8665889396fc1b0c8
4+
refs/heads/snap-stage3: 48048419b10857d487b2580914e40a431d65fd1d
55
refs/heads/try: f5d619caf9f32458680fae55526b99582ca682dd
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d

branches/snap-stage3/mk/crates.mk

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,12 @@ DOC_CRATES := $(filter-out rustc, \
122122
$(filter-out rustc_borrowck, \
123123
$(filter-out rustc_resolve, \
124124
$(filter-out rustc_driver, \
125-
$(filter-out syntax, $(CRATES))))))))
125+
$(filter-out log, \
126+
$(filter-out regex, \
127+
$(filter-out regex_macros, \
128+
$(filter-out getopts, \
129+
$(filter-out time, \
130+
$(filter-out syntax, $(CRATES)))))))))))))
126131
COMPILER_DOC_CRATES := rustc rustc_trans rustc_borrowck rustc_resolve \
127132
rustc_typeck rustc_driver syntax
128133

branches/snap-stage3/mk/docs.mk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,8 @@ LIB_DOC_DEP_$(1) = \
236236
$$(RSINPUTS_$(1)) \
237237
$$(RUSTDOC_EXE) \
238238
$$(foreach dep,$$(RUST_DEPS_$(1)), \
239-
$$(TLIB2_T_$(CFG_BUILD)_H_$(CFG_BUILD))/stamp.$$(dep) \
239+
$$(TLIB2_T_$(CFG_BUILD)_H_$(CFG_BUILD))/stamp.$$(dep)) \
240+
$$(foreach dep,$$(filter $$(DOC_CRATES), $$(RUST_DEPS_$(1))), \
240241
doc/$$(dep)/)
241242
else
242243
LIB_DOC_DEP_$(1) = $$(CRATEFILE_$(1)) $$(RSINPUTS_$(1))

branches/snap-stage3/src/etc/rustup.sh

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -229,18 +229,6 @@ validate_opt() {
229229
done
230230
}
231231

232-
create_tmp_dir() {
233-
local TMP_DIR=./rustup-tmp-install
234-
235-
rm -Rf "${TMP_DIR}"
236-
need_ok "failed to remove temporary installation directory"
237-
238-
mkdir -p "${TMP_DIR}"
239-
need_ok "failed to create create temporary installation directory"
240-
241-
echo $TMP_DIR
242-
}
243-
244232
probe_need CFG_CURL curl
245233
probe_need CFG_TAR tar
246234
probe_need CFG_FILE file
@@ -413,9 +401,7 @@ then
413401
CFG_INSTALL_FLAGS="${CFG_INSTALL_FLAGS} --prefix=${CFG_PREFIX}"
414402
fi
415403

416-
CFG_TMP_DIR=$(mktemp -d 2>/dev/null \
417-
|| mktemp -d -t 'rustup-tmp-install' 2>/dev/null \
418-
|| create_tmp_dir)
404+
CFG_TMP_DIR="./rustup-tmp-install"
419405

420406
RUST_URL="https://static.rust-lang.org/dist"
421407
RUST_PACKAGE_NAME=rust-nightly
@@ -438,6 +424,9 @@ download_package() {
438424

439425
msg "Downloading ${remote_tarball} to ${local_tarball}"
440426

427+
mkdir -p "${CFG_TMP_DIR}"
428+
need_ok "failed to create create download directory"
429+
441430
"${CFG_CURL}" -f -o "${local_tarball}" "${remote_tarball}"
442431
if [ $? -ne 0 ]
443432
then

branches/snap-stage3/src/liballoc/arc.rs

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,11 @@ use core::default::Default;
7676
use core::kinds::{Sync, Send};
7777
use core::mem::{min_align_of, size_of, drop};
7878
use core::mem;
79-
use core::nonzero::NonZero;
8079
use core::ops::{Drop, Deref};
8180
use core::option::Option;
8281
use core::option::Option::{Some, None};
83-
use core::ptr::{mod, RawPtr};
82+
use core::ptr::RawPtr;
83+
use core::ptr;
8484
use heap::deallocate;
8585

8686
/// An atomically reference counted wrapper for shared state.
@@ -114,7 +114,7 @@ use heap::deallocate;
114114
pub struct Arc<T> {
115115
// FIXME #12808: strange name to try to avoid interfering with
116116
// field accesses of the contained type via Deref
117-
_ptr: NonZero<*mut ArcInner<T>>,
117+
_ptr: *mut ArcInner<T>,
118118
}
119119

120120
unsafe impl<T: Sync + Send> Send for Arc<T> { }
@@ -130,7 +130,7 @@ unsafe impl<T: Sync + Send> Sync for Arc<T> { }
130130
pub struct Weak<T> {
131131
// FIXME #12808: strange name to try to avoid interfering with
132132
// field accesses of the contained type via Deref
133-
_ptr: NonZero<*mut ArcInner<T>>,
133+
_ptr: *mut ArcInner<T>,
134134
}
135135

136136
unsafe impl<T: Sync + Send> Send for Weak<T> { }
@@ -165,7 +165,7 @@ impl<T> Arc<T> {
165165
weak: atomic::AtomicUint::new(1),
166166
data: data,
167167
};
168-
Arc { _ptr: unsafe { NonZero::new(mem::transmute(x)) } }
168+
Arc { _ptr: unsafe { mem::transmute(x) } }
169169
}
170170

171171
/// Downgrades the `Arc<T>` to a `Weak<T>` reference.
@@ -194,7 +194,7 @@ impl<T> Arc<T> {
194194
// pointer is valid. Furthermore, we know that the `ArcInner` structure itself is `Sync`
195195
// because the inner data is `Sync` as well, so we're ok loaning out an immutable pointer
196196
// to these contents.
197-
unsafe { &**self._ptr }
197+
unsafe { &*self._ptr }
198198
}
199199
}
200200

@@ -281,7 +281,7 @@ impl<T: Send + Sync + Clone> Arc<T> {
281281
// pointer that will ever be returned to T. Our reference count is guaranteed to be 1 at
282282
// this point, and we required the Arc itself to be `mut`, so we're returning the only
283283
// possible reference to the inner data.
284-
let inner = unsafe { &mut **self._ptr };
284+
let inner = unsafe { &mut *self._ptr };
285285
&mut inner.data
286286
}
287287
}
@@ -316,8 +316,7 @@ impl<T: Sync + Send> Drop for Arc<T> {
316316
fn drop(&mut self) {
317317
// This structure has #[unsafe_no_drop_flag], so this drop glue may run more than once (but
318318
// it is guaranteed to be zeroed after the first if it's run more than once)
319-
let ptr = *self._ptr;
320-
if ptr.is_null() { return }
319+
if self._ptr.is_null() { return }
321320

322321
// Because `fetch_sub` is already atomic, we do not need to synchronize with other threads
323322
// unless we are going to delete the object. This same logic applies to the below
@@ -347,7 +346,7 @@ impl<T: Sync + Send> Drop for Arc<T> {
347346

348347
if self.inner().weak.fetch_sub(1, atomic::Release) == 1 {
349348
atomic::fence(atomic::Acquire);
350-
unsafe { deallocate(ptr as *mut u8, size_of::<ArcInner<T>>(),
349+
unsafe { deallocate(self._ptr as *mut u8, size_of::<ArcInner<T>>(),
351350
min_align_of::<ArcInner<T>>()) }
352351
}
353352
}
@@ -387,7 +386,7 @@ impl<T: Sync + Send> Weak<T> {
387386
#[inline]
388387
fn inner(&self) -> &ArcInner<T> {
389388
// See comments above for why this is "safe"
390-
unsafe { &**self._ptr }
389+
unsafe { &*self._ptr }
391390
}
392391
}
393392

@@ -443,16 +442,14 @@ impl<T: Sync + Send> Drop for Weak<T> {
443442
/// } // implicit drop
444443
/// ```
445444
fn drop(&mut self) {
446-
let ptr = *self._ptr;
447-
448445
// see comments above for why this check is here
449-
if ptr.is_null() { return }
446+
if self._ptr.is_null() { return }
450447

451448
// If we find out that we were the last weak pointer, then its time to deallocate the data
452449
// entirely. See the discussion in Arc::drop() about the memory orderings
453450
if self.inner().weak.fetch_sub(1, atomic::Release) == 1 {
454451
atomic::fence(atomic::Acquire);
455-
unsafe { deallocate(ptr as *mut u8, size_of::<ArcInner<T>>(),
452+
unsafe { deallocate(self._ptr as *mut u8, size_of::<ArcInner<T>>(),
456453
min_align_of::<ArcInner<T>>()) }
457454
}
458455
}

branches/snap-stage3/src/liballoc/rc.rs

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -150,11 +150,11 @@ use core::fmt;
150150
use core::hash::{mod, Hash};
151151
use core::kinds::marker;
152152
use core::mem::{transmute, min_align_of, size_of, forget};
153-
use core::nonzero::NonZero;
154153
use core::ops::{Deref, Drop};
155154
use core::option::Option;
156155
use core::option::Option::{Some, None};
157-
use core::ptr::{mod, RawPtr};
156+
use core::ptr;
157+
use core::ptr::RawPtr;
158158
use core::result::Result;
159159
use core::result::Result::{Ok, Err};
160160

@@ -174,7 +174,7 @@ struct RcBox<T> {
174174
pub struct Rc<T> {
175175
// FIXME #12808: strange names to try to avoid interfering with field accesses of the contained
176176
// type via Deref
177-
_ptr: NonZero<*mut RcBox<T>>,
177+
_ptr: *mut RcBox<T>,
178178
_nosend: marker::NoSend,
179179
_noshare: marker::NoSync
180180
}
@@ -196,11 +196,11 @@ impl<T> Rc<T> {
196196
// there is an implicit weak pointer owned by all the strong pointers, which
197197
// ensures that the weak destructor never frees the allocation while the strong
198198
// destructor is running, even if the weak pointer is stored inside the strong one.
199-
_ptr: NonZero::new(transmute(box RcBox {
199+
_ptr: transmute(box RcBox {
200200
value: value,
201201
strong: Cell::new(1),
202202
weak: Cell::new(1)
203-
})),
203+
}),
204204
_nosend: marker::NoSend,
205205
_noshare: marker::NoSync
206206
}
@@ -281,7 +281,7 @@ pub fn try_unwrap<T>(rc: Rc<T>) -> Result<T, Rc<T>> {
281281
let val = ptr::read(&*rc); // copy the contained object
282282
// destruct the box and skip our Drop
283283
// we can ignore the refcounts because we know we're unique
284-
deallocate(*rc._ptr as *mut u8, size_of::<RcBox<T>>(),
284+
deallocate(rc._ptr as *mut u8, size_of::<RcBox<T>>(),
285285
min_align_of::<RcBox<T>>());
286286
forget(rc);
287287
Ok(val)
@@ -311,7 +311,7 @@ pub fn try_unwrap<T>(rc: Rc<T>) -> Result<T, Rc<T>> {
311311
#[experimental]
312312
pub fn get_mut<'a, T>(rc: &'a mut Rc<T>) -> Option<&'a mut T> {
313313
if is_unique(rc) {
314-
let inner = unsafe { &mut **rc._ptr };
314+
let inner = unsafe { &mut *rc._ptr };
315315
Some(&mut inner.value)
316316
} else {
317317
None
@@ -343,7 +343,7 @@ impl<T: Clone> Rc<T> {
343343
// pointer that will ever be returned to T. Our reference count is guaranteed to be 1 at
344344
// this point, and we required the `Rc<T>` itself to be `mut`, so we're returning the only
345345
// possible reference to the inner value.
346-
let inner = unsafe { &mut **self._ptr };
346+
let inner = unsafe { &mut *self._ptr };
347347
&mut inner.value
348348
}
349349
}
@@ -391,8 +391,7 @@ impl<T> Drop for Rc<T> {
391391
/// ```
392392
fn drop(&mut self) {
393393
unsafe {
394-
let ptr = *self._ptr;
395-
if !ptr.is_null() {
394+
if !self._ptr.is_null() {
396395
self.dec_strong();
397396
if self.strong() == 0 {
398397
ptr::read(&**self); // destroy the contained object
@@ -402,7 +401,7 @@ impl<T> Drop for Rc<T> {
402401
self.dec_weak();
403402

404403
if self.weak() == 0 {
405-
deallocate(ptr as *mut u8, size_of::<RcBox<T>>(),
404+
deallocate(self._ptr as *mut u8, size_of::<RcBox<T>>(),
406405
min_align_of::<RcBox<T>>())
407406
}
408407
}
@@ -619,7 +618,7 @@ impl<T: fmt::Show> fmt::Show for Rc<T> {
619618
pub struct Weak<T> {
620619
// FIXME #12808: strange names to try to avoid interfering with
621620
// field accesses of the contained type via Deref
622-
_ptr: NonZero<*mut RcBox<T>>,
621+
_ptr: *mut RcBox<T>,
623622
_nosend: marker::NoSend,
624623
_noshare: marker::NoSync
625624
}
@@ -683,13 +682,12 @@ impl<T> Drop for Weak<T> {
683682
/// ```
684683
fn drop(&mut self) {
685684
unsafe {
686-
let ptr = *self._ptr;
687-
if !ptr.is_null() {
685+
if !self._ptr.is_null() {
688686
self.dec_weak();
689687
// the weak count starts at 1, and will only go to zero if all the strong pointers
690688
// have disappeared.
691689
if self.weak() == 0 {
692-
deallocate(ptr as *mut u8, size_of::<RcBox<T>>(),
690+
deallocate(self._ptr as *mut u8, size_of::<RcBox<T>>(),
693691
min_align_of::<RcBox<T>>())
694692
}
695693
}
@@ -744,12 +742,12 @@ trait RcBoxPtr<T> {
744742

745743
impl<T> RcBoxPtr<T> for Rc<T> {
746744
#[inline(always)]
747-
fn inner(&self) -> &RcBox<T> { unsafe { &(**self._ptr) } }
745+
fn inner(&self) -> &RcBox<T> { unsafe { &(*self._ptr) } }
748746
}
749747

750748
impl<T> RcBoxPtr<T> for Weak<T> {
751749
#[inline(always)]
752-
fn inner(&self) -> &RcBox<T> { unsafe { &(**self._ptr) } }
750+
fn inner(&self) -> &RcBox<T> { unsafe { &(*self._ptr) } }
753751
}
754752

755753
#[cfg(test)]

branches/snap-stage3/src/libcollections/dlist.rs

Lines changed: 4 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,6 @@ impl<'a, A> DoubleEndedIterator<&'a mut A> for IterMut<'a, A> {
655655
impl<'a, A> ExactSizeIterator<&'a mut A> for IterMut<'a, A> {}
656656

657657
/// Allows mutating a `DList` while iterating.
658-
#[deprecated = "Trait is deprecated, use inherent methods on the iterator instead"]
659658
pub trait ListInsertion<A> {
660659
/// Inserts `elt` just after to the element most recently returned by
661660
/// `.next()`
@@ -690,50 +689,14 @@ impl<'a, A> IterMut<'a, A> {
690689
}
691690
}
692691

693-
impl<'a, A> IterMut<'a, A> {
694-
/// Inserts `elt` just after the element most recently returned by `.next()`.
695-
/// The inserted element does not appear in the iteration.
696-
///
697-
/// # Examples
698-
///
699-
/// ```rust
700-
/// use std::collections::DList;
701-
///
702-
/// let mut list: DList<int> = vec![1, 3, 4].into_iter().collect();
703-
///
704-
/// {
705-
/// let mut it = list.iter_mut();
706-
/// assert_eq!(it.next().unwrap(), &1);
707-
/// // insert `2` after `1`
708-
/// it.insert_next(2);
709-
/// }
710-
/// {
711-
/// let vec: Vec<int> = list.into_iter().collect();
712-
/// assert_eq!(vec, vec![1i, 2, 3, 4]);
713-
/// }
714-
/// ```
692+
impl<'a, A> ListInsertion<A> for IterMut<'a, A> {
715693
#[inline]
716-
pub fn insert_next(&mut self, elt: A) {
694+
fn insert_next(&mut self, elt: A) {
717695
self.insert_next_node(box Node::new(elt))
718696
}
719697

720-
/// Provides a reference to the next element, without changing the iterator.
721-
///
722-
/// # Examples
723-
///
724-
/// ```rust
725-
/// use std::collections::DList;
726-
///
727-
/// let mut list: DList<int> = vec![1, 2, 3].into_iter().collect();
728-
///
729-
/// let mut it = list.iter_mut();
730-
/// assert_eq!(it.next().unwrap(), &1);
731-
/// assert_eq!(it.peek_next().unwrap(), &2);
732-
/// // We just peeked at 2, so it was not consumed from the iterator.
733-
/// assert_eq!(it.next().unwrap(), &2);
734-
/// ```
735698
#[inline]
736-
pub fn peek_next(&mut self) -> Option<&mut A> {
699+
fn peek_next(&mut self) -> Option<&mut A> {
737700
if self.nelem == 0 {
738701
return None
739702
}
@@ -835,7 +798,7 @@ mod tests {
835798
use test::Bencher;
836799
use test;
837800

838-
use super::{DList, Node};
801+
use super::{DList, Node, ListInsertion};
839802

840803
pub fn check_links<T>(list: &DList<T>) {
841804
let mut len = 0u;

0 commit comments

Comments
 (0)