Skip to content

Commit d381f28

Browse files
committed
---
yaml --- r: 195007 b: refs/heads/beta c: 9c9bb9c h: refs/heads/master i: 195005: c7169e5 195003: 7db93fe 194999: abc300d 194991: d4cef3d 194975: 09b4b4c 194943: 908a4cf v: v3
1 parent bf17d00 commit d381f28

Some content is hidden

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

86 files changed

+499
-1594
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ refs/heads/automation-fail: 1bf06495443584539b958873e04cc2f864ab10e4
3131
refs/heads/issue-18208-method-dispatch-3-quick-reject: 2009f85b9f99dedcec4404418eda9ddba90258a2
3232
refs/heads/batch: b7fd822592a4fb577552d93010c4a4e14f314346
3333
refs/heads/building: 126db549b038c84269a1e4fe46f051b2c15d6970
34-
refs/heads/beta: adbb5160675bcb9aba0569782ff15061b4dbbb92
34+
refs/heads/beta: 9c9bb9ce1d51e2a9ca4963bd418e365b6e17fbfa
3535
refs/heads/windistfix: 7608dbad651f02e837ed05eef3d74a6662a6e928
3636
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
3737
refs/heads/tmp: be7f6ac7008f8ddf980ac07026b05bdd865f29cc

branches/beta/mk/tests.mk

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -569,11 +569,6 @@ ifeq ($(CFG_OSTYPE),apple-darwin)
569569
CTEST_DISABLE_debuginfo-gdb = "gdb on darwin needs root"
570570
endif
571571

572-
ifeq ($(findstring android, $(CFG_TARGET)), android)
573-
CTEST_DISABLE_debuginfo-gdb =
574-
CTEST_DISABLE_debuginfo-lldb = "lldb tests are disabled on android"
575-
endif
576-
577572
# CTEST_DISABLE_NONSELFHOST_$(TEST_GROUP), if set, will cause that
578573
# test group to be disabled *unless* the target is able to build a
579574
# compiler (i.e. when the target triple is in the set of of host

branches/beta/src/doc/trpl/pointers.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -568,8 +568,8 @@ fn add(x: &i32, y: &i32) -> i32 {
568568
fn main() {
569569
let x = Box::new(5);
570570
571-
println!("{}", add(&*x, &*x));
572-
println!("{}", add(&*x, &*x));
571+
println!("{}", add(&x, &x));
572+
println!("{}", add(&x, &x));
573573
}
574574
```
575575

branches/beta/src/liballoc/arc.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -354,8 +354,7 @@ impl<T> Drop for Arc<T> {
354354
// more than once (but it is guaranteed to be zeroed after the first if
355355
// it's run more than once)
356356
let ptr = *self._ptr;
357-
// if ptr.is_null() { return }
358-
if ptr.is_null() || ptr as usize == mem::POST_DROP_USIZE { return }
357+
if ptr.is_null() { return }
359358

360359
// Because `fetch_sub` is already atomic, we do not need to synchronize
361360
// with other threads unless we are going to delete the object. This
@@ -486,7 +485,7 @@ impl<T> Drop for Weak<T> {
486485
let ptr = *self._ptr;
487486

488487
// see comments above for why this check is here
489-
if ptr.is_null() || ptr as usize == mem::POST_DROP_USIZE { return }
488+
if ptr.is_null() { return }
490489

491490
// If we find out that we were the last weak pointer, then its time to
492491
// deallocate the data entirely. See the discussion in Arc::drop() about

branches/beta/src/liballoc/boxed.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -244,13 +244,13 @@ pub trait BoxAny {
244244
/// Returns the boxed value if it is of type `T`, or
245245
/// `Err(Self)` if it isn't.
246246
#[stable(feature = "rust1", since = "1.0.0")]
247-
fn downcast<T: 'static>(self) -> Result<Box<T>, Box<Any>>;
247+
fn downcast<T: Any>(self) -> Result<Box<T>, Box<Any>>;
248248
}
249249

250250
#[stable(feature = "rust1", since = "1.0.0")]
251251
impl BoxAny for Box<Any> {
252252
#[inline]
253-
fn downcast<T: 'static>(self) -> Result<Box<T>, Box<Any>> {
253+
fn downcast<T: Any>(self) -> Result<Box<T>, Box<Any>> {
254254
if self.is::<T>() {
255255
unsafe {
256256
// Get the raw representation of the trait object
@@ -270,7 +270,7 @@ impl BoxAny for Box<Any> {
270270
#[stable(feature = "rust1", since = "1.0.0")]
271271
impl BoxAny for Box<Any+Send> {
272272
#[inline]
273-
fn downcast<T: 'static>(self) -> Result<Box<T>, Box<Any>> {
273+
fn downcast<T: Any>(self) -> Result<Box<T>, Box<Any>> {
274274
<Box<Any>>::downcast(self)
275275
}
276276
}

branches/beta/src/liballoc/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
#![feature(box_syntax)]
7676
#![feature(optin_builtin_traits)]
7777
#![feature(unboxed_closures)]
78-
#![feature(unsafe_no_drop_flag, filling_drop)]
78+
#![feature(unsafe_no_drop_flag)]
7979
#![feature(core)]
8080
#![feature(unique)]
8181
#![cfg_attr(test, feature(test, alloc, rustc_private))]

branches/beta/src/liballoc/rc.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ use core::default::Default;
160160
use core::fmt;
161161
use core::hash::{Hasher, Hash};
162162
use core::marker;
163-
use core::mem::{self, min_align_of, size_of, forget};
163+
use core::mem::{min_align_of, size_of, forget};
164164
use core::nonzero::NonZero;
165165
use core::ops::{Deref, Drop};
166166
use core::option::Option;
@@ -407,7 +407,7 @@ impl<T> Drop for Rc<T> {
407407
fn drop(&mut self) {
408408
unsafe {
409409
let ptr = *self._ptr;
410-
if !ptr.is_null() && ptr as usize != mem::POST_DROP_USIZE {
410+
if !ptr.is_null() {
411411
self.dec_strong();
412412
if self.strong() == 0 {
413413
ptr::read(&**self); // destroy the contained object
@@ -718,7 +718,7 @@ impl<T> Drop for Weak<T> {
718718
fn drop(&mut self) {
719719
unsafe {
720720
let ptr = *self._ptr;
721-
if !ptr.is_null() && ptr as usize != mem::POST_DROP_USIZE {
721+
if !ptr.is_null() {
722722
self.dec_weak();
723723
// the weak count starts at 1, and will only go to zero if all
724724
// the strong pointers have disappeared.

branches/beta/src/libcollections/btree/map.rs

Lines changed: 12 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1143,39 +1143,15 @@ impl<'a, K, V> DoubleEndedIterator for RangeMut<'a, K, V> {
11431143
}
11441144

11451145
impl<'a, K: Ord, V> Entry<'a, K, V> {
1146+
/// Returns a mutable reference to the entry if occupied, or the VacantEntry if vacant
11461147
#[unstable(feature = "std_misc",
11471148
reason = "will soon be replaced by or_insert")]
1148-
#[deprecated(since = "1.0",
1149-
reason = "replaced with more ergonomic `or_insert` and `or_insert_with`")]
1150-
/// Returns a mutable reference to the entry if occupied, or the VacantEntry if vacant
11511149
pub fn get(self) -> Result<&'a mut V, VacantEntry<'a, K, V>> {
11521150
match self {
11531151
Occupied(entry) => Ok(entry.into_mut()),
11541152
Vacant(entry) => Err(entry),
11551153
}
11561154
}
1157-
1158-
#[unstable(feature = "collections",
1159-
reason = "matches entry v3 specification, waiting for dust to settle")]
1160-
/// Ensures a value is in the entry by inserting the default if empty, and returns
1161-
/// a mutable reference to the value in the entry.
1162-
pub fn or_insert(self, default: V) -> &'a mut V {
1163-
match self {
1164-
Occupied(entry) => entry.into_mut(),
1165-
Vacant(entry) => entry.insert(default),
1166-
}
1167-
}
1168-
1169-
#[unstable(feature = "collections",
1170-
reason = "matches entry v3 specification, waiting for dust to settle")]
1171-
/// Ensures a value is in the entry by inserting the result of the default function if empty,
1172-
/// and returns a mutable reference to the value in the entry.
1173-
pub fn or_insert_with<F: FnOnce() -> V>(self, default: F) -> &'a mut V {
1174-
match self {
1175-
Occupied(entry) => entry.into_mut(),
1176-
Vacant(entry) => entry.insert(default()),
1177-
}
1178-
}
11791155
}
11801156

11811157
impl<'a, K: Ord, V> VacantEntry<'a, K, V> {
@@ -1587,12 +1563,21 @@ impl<K: Ord, V> BTreeMap<K, V> {
15871563
/// ```
15881564
/// # #![feature(collections)]
15891565
/// use std::collections::BTreeMap;
1566+
/// use std::collections::btree_map::Entry;
15901567
///
15911568
/// let mut count: BTreeMap<&str, usize> = BTreeMap::new();
15921569
///
15931570
/// // count the number of occurrences of letters in the vec
1594-
/// for x in vec!["a","b","a","c","a","b"] {
1595-
/// *count.entry(x).or_insert(0) += 1;
1571+
/// for x in vec!["a","b","a","c","a","b"].iter() {
1572+
/// match count.entry(*x) {
1573+
/// Entry::Vacant(view) => {
1574+
/// view.insert(1);
1575+
/// },
1576+
/// Entry::Occupied(mut view) => {
1577+
/// let v = view.get_mut();
1578+
/// *v += 1;
1579+
/// },
1580+
/// }
15961581
/// }
15971582
///
15981583
/// assert_eq!(count["a"], 3);

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -280,11 +280,9 @@ impl<T> Drop for RawItems<T> {
280280
#[unsafe_destructor]
281281
impl<K, V> Drop for Node<K, V> {
282282
fn drop(&mut self) {
283-
if self.keys.is_null() ||
284-
(unsafe { self.keys.get() as *const K as usize == mem::POST_DROP_USIZE })
285-
{
283+
if self.keys.is_null() {
286284
// Since we have #[unsafe_no_drop_flag], we have to watch
287-
// out for the sentinel value being stored in self.keys. (Using
285+
// out for a null value being stored in self.keys. (Using
288286
// null is technically a violation of the `Unique`
289287
// requirements, though.)
290288
return;

branches/beta/src/libcollections/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
#![feature(unicode)]
3737
#![feature(unsafe_destructor)]
3838
#![feature(unique)]
39-
#![feature(unsafe_no_drop_flag, filling_drop)]
39+
#![feature(unsafe_no_drop_flag)]
4040
#![feature(step_by)]
4141
#![feature(str_char)]
4242
#![feature(convert)]

branches/beta/src/libcollections/vec.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1694,7 +1694,7 @@ impl<T> Drop for Vec<T> {
16941694
fn drop(&mut self) {
16951695
// This is (and should always remain) a no-op if the fields are
16961696
// zeroed (when moving out, because of #[unsafe_no_drop_flag]).
1697-
if self.cap != 0 && self.cap != mem::POST_DROP_USIZE {
1697+
if self.cap != 0 {
16981698
unsafe {
16991699
for x in &*self {
17001700
ptr::read(x);
@@ -1977,7 +1977,7 @@ impl<'a, T> ExactSizeIterator for Drain<'a, T> {}
19771977
#[stable(feature = "rust1", since = "1.0.0")]
19781978
impl<'a, T> Drop for Drain<'a, T> {
19791979
fn drop(&mut self) {
1980-
// self.ptr == self.end == mem::POST_DROP_USIZE if drop has already been called,
1980+
// self.ptr == self.end == null if drop has already been called,
19811981
// so we can use #[unsafe_no_drop_flag].
19821982

19831983
// destroy the remaining elements

branches/beta/src/libcollections/vec_map.rs

Lines changed: 11 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -632,12 +632,21 @@ impl<V> VecMap<V> {
632632
/// ```
633633
/// # #![feature(collections)]
634634
/// use std::collections::VecMap;
635+
/// use std::collections::vec_map::Entry;
635636
///
636637
/// let mut count: VecMap<u32> = VecMap::new();
637638
///
638639
/// // count the number of occurrences of numbers in the vec
639-
/// for x in vec![1, 2, 1, 2, 3, 4, 1, 2, 4] {
640-
/// *count.entry(x).or_insert(0) += 1;
640+
/// for x in vec![1, 2, 1, 2, 3, 4, 1, 2, 4].iter() {
641+
/// match count.entry(*x) {
642+
/// Entry::Vacant(view) => {
643+
/// view.insert(1);
644+
/// },
645+
/// Entry::Occupied(mut view) => {
646+
/// let v = view.get_mut();
647+
/// *v += 1;
648+
/// },
649+
/// }
641650
/// }
642651
///
643652
/// assert_eq!(count[1], 3);
@@ -666,37 +675,13 @@ impl<V> VecMap<V> {
666675
impl<'a, V> Entry<'a, V> {
667676
#[unstable(feature = "collections",
668677
reason = "will soon be replaced by or_insert")]
669-
#[deprecated(since = "1.0",
670-
reason = "replaced with more ergonomic `or_insert` and `or_insert_with`")]
671678
/// Returns a mutable reference to the entry if occupied, or the VacantEntry if vacant
672679
pub fn get(self) -> Result<&'a mut V, VacantEntry<'a, V>> {
673680
match self {
674681
Occupied(entry) => Ok(entry.into_mut()),
675682
Vacant(entry) => Err(entry),
676683
}
677684
}
678-
679-
#[unstable(feature = "collections",
680-
reason = "matches entry v3 specification, waiting for dust to settle")]
681-
/// Ensures a value is in the entry by inserting the default if empty, and returns
682-
/// a mutable reference to the value in the entry.
683-
pub fn or_insert(self, default: V) -> &'a mut V {
684-
match self {
685-
Occupied(entry) => entry.into_mut(),
686-
Vacant(entry) => entry.insert(default),
687-
}
688-
}
689-
690-
#[unstable(feature = "collections",
691-
reason = "matches entry v3 specification, waiting for dust to settle")]
692-
/// Ensures a value is in the entry by inserting the result of the default function if empty,
693-
/// and returns a mutable reference to the value in the entry.
694-
pub fn or_insert_with<F: FnOnce() -> V>(self, default: F) -> &'a mut V {
695-
match self {
696-
Occupied(entry) => entry.into_mut(),
697-
Vacant(entry) => entry.insert(default()),
698-
}
699-
}
700685
}
701686

702687
impl<'a, V> VacantEntry<'a, V> {

branches/beta/src/libcore/any.rs

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
//! }
5656
//!
5757
//! // This function wants to log its parameter out prior to doing work with it.
58-
//! fn do_work<T: Debug + 'static>(value: &T) {
58+
//! fn do_work<T: Any + Debug>(value: &T) {
5959
//! log(value);
6060
//! // ...do some other work
6161
//! }
@@ -76,7 +76,7 @@ use mem::transmute;
7676
use option::Option::{self, Some, None};
7777
use raw::TraitObject;
7878
use intrinsics;
79-
use marker::Sized;
79+
use marker::{Reflect, Sized};
8080

8181
///////////////////////////////////////////////////////////////////////////////
8282
// Any trait
@@ -88,14 +88,16 @@ use marker::Sized;
8888
///
8989
/// [mod]: ../index.html
9090
#[stable(feature = "rust1", since = "1.0.0")]
91-
pub trait Any: 'static {
91+
pub trait Any: Reflect + 'static {
9292
/// Get the `TypeId` of `self`
9393
#[unstable(feature = "core",
9494
reason = "this method will likely be replaced by an associated static")]
9595
fn get_type_id(&self) -> TypeId;
9696
}
9797

98-
impl<T: 'static> Any for T {
98+
impl<T> Any for T
99+
where T: Reflect + 'static
100+
{
99101
fn get_type_id(&self) -> TypeId { TypeId::of::<T>() }
100102
}
101103

@@ -107,7 +109,7 @@ impl Any {
107109
/// Returns true if the boxed type is the same as `T`
108110
#[stable(feature = "rust1", since = "1.0.0")]
109111
#[inline]
110-
pub fn is<T: 'static>(&self) -> bool {
112+
pub fn is<T: Any>(&self) -> bool {
111113
// Get TypeId of the type this function is instantiated with
112114
let t = TypeId::of::<T>();
113115

@@ -122,7 +124,7 @@ impl Any {
122124
/// `None` if it isn't.
123125
#[stable(feature = "rust1", since = "1.0.0")]
124126
#[inline]
125-
pub fn downcast_ref<T: 'static>(&self) -> Option<&T> {
127+
pub fn downcast_ref<T: Any>(&self) -> Option<&T> {
126128
if self.is::<T>() {
127129
unsafe {
128130
// Get the raw representation of the trait object
@@ -140,7 +142,7 @@ impl Any {
140142
/// `None` if it isn't.
141143
#[stable(feature = "rust1", since = "1.0.0")]
142144
#[inline]
143-
pub fn downcast_mut<T: 'static>(&mut self) -> Option<&mut T> {
145+
pub fn downcast_mut<T: Any>(&mut self) -> Option<&mut T> {
144146
if self.is::<T>() {
145147
unsafe {
146148
// Get the raw representation of the trait object
@@ -159,21 +161,21 @@ impl Any+Send {
159161
/// Forwards to the method defined on the type `Any`.
160162
#[stable(feature = "rust1", since = "1.0.0")]
161163
#[inline]
162-
pub fn is<T: 'static>(&self) -> bool {
164+
pub fn is<T: Any>(&self) -> bool {
163165
Any::is::<T>(self)
164166
}
165167

166168
/// Forwards to the method defined on the type `Any`.
167169
#[stable(feature = "rust1", since = "1.0.0")]
168170
#[inline]
169-
pub fn downcast_ref<T: 'static>(&self) -> Option<&T> {
171+
pub fn downcast_ref<T: Any>(&self) -> Option<&T> {
170172
Any::downcast_ref::<T>(self)
171173
}
172174

173175
/// Forwards to the method defined on the type `Any`.
174176
#[stable(feature = "rust1", since = "1.0.0")]
175177
#[inline]
176-
pub fn downcast_mut<T: 'static>(&mut self) -> Option<&mut T> {
178+
pub fn downcast_mut<T: Any>(&mut self) -> Option<&mut T> {
177179
Any::downcast_mut::<T>(self)
178180
}
179181
}
@@ -202,7 +204,7 @@ impl TypeId {
202204
/// instantiated with
203205
#[unstable(feature = "core",
204206
reason = "may grow a `Reflect` bound soon via marker traits")]
205-
pub fn of<T: ?Sized + 'static>() -> TypeId {
207+
pub fn of<T: ?Sized + Any>() -> TypeId {
206208
TypeId {
207209
t: unsafe { intrinsics::type_id::<T>() },
208210
}

0 commit comments

Comments
 (0)