Skip to content

Commit 15f2bb9

Browse files
committed
---
yaml --- r: 194483 b: refs/heads/try c: 8165bc1 h: refs/heads/master i: 194481: 98b14b6 194479: f7d1955 v: v3
1 parent 7189362 commit 15f2bb9

Some content is hidden

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

46 files changed

+169
-710
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: 242ed0b7c0f6a21096f2cc3e1ad1bdb176d02545
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: a923278c6278c63468d74772c58dbf788e88f58c
5-
refs/heads/try: a21e18fe04a338ae46fd2ce610d5701e3683293e
5+
refs/heads/try: 8165bc14fbc8456c35dc54fb6255456bea30db59
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
88
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/try/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/try/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/try/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/try/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/try/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/try/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/try/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/try/src/libcore/intrinsics.rs

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -191,35 +191,13 @@ extern "rust-intrinsic" {
191191
/// crate it is invoked in.
192192
pub fn type_id<T: ?Sized + 'static>() -> u64;
193193

194-
/// Create a value initialized to so that its drop flag,
195-
/// if any, says that it has been dropped.
196-
///
197-
/// `init_dropped` is unsafe because it returns a datum with all
198-
/// of its bytes set to the drop flag, which generally does not
199-
/// correspond to a valid value.
200-
///
201-
/// This intrinsic is likely to be deprecated in the future when
202-
/// Rust moves to non-zeroing dynamic drop (and thus removes the
203-
/// embedded drop flags that are being established by this
204-
/// intrinsic).
205-
#[cfg(not(stage0))]
206-
pub fn init_dropped<T>() -> T;
207-
208194
/// Create a value initialized to zero.
209195
///
210196
/// `init` is unsafe because it returns a zeroed-out datum,
211-
/// which is unsafe unless T is `Copy`. Also, even if T is
212-
/// `Copy`, an all-zero value may not correspond to any legitimate
213-
/// state for the type in question.
197+
/// which is unsafe unless T is Copy.
214198
pub fn init<T>() -> T;
215199

216200
/// Create an uninitialized value.
217-
///
218-
/// `uninit` is unsafe because there is no guarantee of what its
219-
/// contents are. In particular its drop-flag may be set to any
220-
/// state, which means it may claim either dropped or
221-
/// undropped. In the general case one must use `ptr::write` to
222-
/// initialize memory previous set to the result of `uninit`.
223201
pub fn uninit<T>() -> T;
224202

225203
/// Move a value out of scope without running drop glue.

branches/try/src/libcore/mem.rs

Lines changed: 0 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -158,32 +158,6 @@ pub unsafe fn zeroed<T>() -> T {
158158
intrinsics::init()
159159
}
160160

161-
/// Create a value initialized to an unspecified series of bytes.
162-
///
163-
/// The byte sequence usually indicates that the value at the memory
164-
/// in question has been dropped. Thus, *if* T carries a drop flag,
165-
/// any associated destructor will not be run when the value falls out
166-
/// of scope.
167-
///
168-
/// Some code at one time used the `zeroed` function above to
169-
/// accomplish this goal.
170-
///
171-
/// This function is expected to be deprecated with the transition
172-
/// to non-zeroing drop.
173-
#[inline]
174-
#[unstable(feature = "filling_drop")]
175-
pub unsafe fn dropped<T>() -> T {
176-
#[cfg(stage0)]
177-
#[inline(always)]
178-
unsafe fn dropped_impl<T>() -> T { zeroed() }
179-
180-
#[cfg(not(stage0))]
181-
#[inline(always)]
182-
unsafe fn dropped_impl<T>() -> T { intrinsics::init_dropped() }
183-
184-
dropped_impl()
185-
}
186-
187161
/// Create an uninitialized value.
188162
///
189163
/// Care must be taken when using this function, if the type `T` has a destructor and the value
@@ -317,49 +291,6 @@ pub fn replace<T>(dest: &mut T, mut src: T) -> T {
317291
#[stable(feature = "rust1", since = "1.0.0")]
318292
pub fn drop<T>(_x: T) { }
319293

320-
macro_rules! repeat_u8_as_u32 {
321-
($name:expr) => { (($name as u32) << 24 |
322-
($name as u32) << 16 |
323-
($name as u32) << 8 |
324-
($name as u32)) }
325-
}
326-
macro_rules! repeat_u8_as_u64 {
327-
($name:expr) => { ((repeat_u8_as_u32!($name) as u64) << 32 |
328-
(repeat_u8_as_u32!($name) as u64)) }
329-
}
330-
331-
// NOTE: Keep synchronized with values used in librustc_trans::trans::adt.
332-
//
333-
// In particular, the POST_DROP_U8 marker must never equal the
334-
// DTOR_NEEDED_U8 marker.
335-
//
336-
// For a while pnkfelix was using 0xc1 here.
337-
// But having the sign bit set is a pain, so 0x1d is probably better.
338-
//
339-
// And of course, 0x00 brings back the old world of zero'ing on drop.
340-
#[cfg(not(stage0))] #[unstable(feature = "filling_drop")]
341-
pub const POST_DROP_U8: u8 = 0x1d;
342-
#[cfg(not(stage0))] #[unstable(feature = "filling_drop")]
343-
pub const POST_DROP_U32: u32 = repeat_u8_as_u32!(POST_DROP_U8);
344-
#[cfg(not(stage0))] #[unstable(feature = "filling_drop")]
345-
pub const POST_DROP_U64: u64 = repeat_u8_as_u64!(POST_DROP_U8);
346-
347-
#[cfg(target_pointer_width = "32")]
348-
#[cfg(not(stage0))] #[unstable(feature = "filling_drop")]
349-
pub const POST_DROP_USIZE: usize = POST_DROP_U32 as usize;
350-
#[cfg(target_pointer_width = "64")]
351-
#[cfg(not(stage0))] #[unstable(feature = "filling_drop")]
352-
pub const POST_DROP_USIZE: usize = POST_DROP_U64 as usize;
353-
354-
#[cfg(stage0)] #[unstable(feature = "filling_drop")]
355-
pub const POST_DROP_U8: u8 = 0;
356-
#[cfg(stage0)] #[unstable(feature = "filling_drop")]
357-
pub const POST_DROP_U32: u32 = 0;
358-
#[cfg(stage0)] #[unstable(feature = "filling_drop")]
359-
pub const POST_DROP_U64: u64 = 0;
360-
#[cfg(stage0)] #[unstable(feature = "filling_drop")]
361-
pub const POST_DROP_USIZE: usize = 0;
362-
363294
/// Interprets `src` as `&U`, and then reads `src` without moving the contained value.
364295
///
365296
/// This function will unsafely assume the pointer `src` is valid for `sizeof(U)` bytes by

branches/try/src/libcore/ops.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -995,10 +995,8 @@ impl fmt::Debug for RangeFull {
995995
#[stable(feature = "rust1", since = "1.0.0")]
996996
pub struct Range<Idx> {
997997
/// The lower bound of the range (inclusive).
998-
#[stable(feature = "rust1", since = "1.0.0")]
999998
pub start: Idx,
1000999
/// The upper bound of the range (exclusive).
1001-
#[stable(feature = "rust1", since = "1.0.0")]
10021000
pub end: Idx,
10031001
}
10041002

@@ -1015,10 +1013,11 @@ impl<Idx: fmt::Debug> fmt::Debug for Range<Idx> {
10151013
#[stable(feature = "rust1", since = "1.0.0")]
10161014
pub struct RangeFrom<Idx> {
10171015
/// The lower bound of the range (inclusive).
1018-
#[stable(feature = "rust1", since = "1.0.0")]
10191016
pub start: Idx,
10201017
}
10211018

1019+
1020+
10221021
#[stable(feature = "rust1", since = "1.0.0")]
10231022
impl<Idx: fmt::Debug> fmt::Debug for RangeFrom<Idx> {
10241023
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
@@ -1032,7 +1031,6 @@ impl<Idx: fmt::Debug> fmt::Debug for RangeFrom<Idx> {
10321031
#[stable(feature = "rust1", since = "1.0.0")]
10331032
pub struct RangeTo<Idx> {
10341033
/// The upper bound of the range (exclusive).
1035-
#[stable(feature = "rust1", since = "1.0.0")]
10361034
pub end: Idx,
10371035
}
10381036

@@ -1043,6 +1041,7 @@ impl<Idx: fmt::Debug> fmt::Debug for RangeTo<Idx> {
10431041
}
10441042
}
10451043

1044+
10461045
/// The `Deref` trait is used to specify the functionality of dereferencing
10471046
/// operations like `*v`.
10481047
///

branches/try/src/libcore/ptr.rs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -230,21 +230,6 @@ pub unsafe fn read_and_zero<T>(dest: *mut T) -> T {
230230
tmp
231231
}
232232

233-
/// Variant of read_and_zero that writes the specific drop-flag byte
234-
/// (which may be more appropriate than zero).
235-
#[inline(always)]
236-
#[unstable(feature = "core",
237-
reason = "may play a larger role in std::ptr future extensions")]
238-
pub unsafe fn read_and_drop<T>(dest: *mut T) -> T {
239-
// Copy the data out from `dest`:
240-
let tmp = read(&*dest);
241-
242-
// Now mark `dest` as dropped:
243-
write_bytes(dest, mem::POST_DROP_U8, 1);
244-
245-
tmp
246-
}
247-
248233
/// Overwrites a memory location with the given value without reading or
249234
/// dropping the old value.
250235
///

branches/try/src/librustc/middle/infer/error_reporting.rs

Lines changed: 29 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -357,9 +357,23 @@ impl<'a, 'tcx> ErrorReporting<'tcx> for InferCtxt<'a, 'tcx> {
357357
}
358358
};
359359

360+
let message_root_str = match trace.origin {
361+
infer::Misc(_) => "mismatched types",
362+
infer::MethodCompatCheck(_) => "method not compatible with trait",
363+
infer::ExprAssignable(_) => "mismatched types",
364+
infer::RelateTraitRefs(_) => "mismatched traits",
365+
infer::RelateSelfType(_) => "mismatched types",
366+
infer::RelateOutputImplTypes(_) => "mismatched types",
367+
infer::MatchExpressionArm(_, _) => "match arms have incompatible types",
368+
infer::IfExpression(_) => "if and else have incompatible types",
369+
infer::IfExpressionWithNoElse(_) => "if may be missing an else clause",
370+
infer::RangeExpression(_) => "start and end of range have incompatible types",
371+
infer::EquatePredicate(_) => "equality predicate not satisfied",
372+
};
373+
360374
span_err!(self.tcx.sess, trace.origin.span(), E0308,
361375
"{}: {} ({})",
362-
trace.origin,
376+
message_root_str,
363377
expected_found_str,
364378
ty::type_err_to_str(self.tcx, terr));
365379

@@ -1481,38 +1495,38 @@ impl<'a, 'tcx> ErrorReportingHelpers<'tcx> for InferCtxt<'a, 'tcx> {
14811495
infer::Subtype(ref trace) => {
14821496
let desc = match trace.origin {
14831497
infer::Misc(_) => {
1484-
"types are compatible"
1498+
format!("types are compatible")
14851499
}
14861500
infer::MethodCompatCheck(_) => {
1487-
"method type is compatible with trait"
1501+
format!("method type is compatible with trait")
14881502
}
14891503
infer::ExprAssignable(_) => {
1490-
"expression is assignable"
1504+
format!("expression is assignable")
14911505
}
14921506
infer::RelateTraitRefs(_) => {
1493-
"traits are compatible"
1507+
format!("traits are compatible")
14941508
}
14951509
infer::RelateSelfType(_) => {
1496-
"self type matches impl self type"
1510+
format!("self type matches impl self type")
14971511
}
14981512
infer::RelateOutputImplTypes(_) => {
1499-
"trait type parameters matches those \
1500-
specified on the impl"
1513+
format!("trait type parameters matches those \
1514+
specified on the impl")
15011515
}
15021516
infer::MatchExpressionArm(_, _) => {
1503-
"match arms have compatible types"
1517+
format!("match arms have compatible types")
15041518
}
15051519
infer::IfExpression(_) => {
1506-
"if and else have compatible types"
1520+
format!("if and else have compatible types")
15071521
}
15081522
infer::IfExpressionWithNoElse(_) => {
1509-
"if may be missing an else clause"
1523+
format!("if may be missing an else clause")
15101524
}
15111525
infer::RangeExpression(_) => {
1512-
"start and end of range have compatible types"
1526+
format!("start and end of range have compatible types")
15131527
}
15141528
infer::EquatePredicate(_) => {
1515-
"equality where clause is satisfied"
1529+
format!("equality where clause is satisfied")
15161530
}
15171531
};
15181532

@@ -1652,8 +1666,8 @@ impl<'a, 'tcx> ErrorReportingHelpers<'tcx> for InferCtxt<'a, 'tcx> {
16521666
infer::RelateRegionParamBound(span) => {
16531667
self.tcx.sess.span_note(
16541668
span,
1655-
"...so that the declared lifetime parameter bounds \
1656-
are satisfied");
1669+
&format!("...so that the declared lifetime parameter bounds \
1670+
are satisfied"));
16571671
}
16581672
infer::SafeDestructor(span) => {
16591673
self.tcx.sess.span_note(

0 commit comments

Comments
 (0)