Skip to content

Commit 17c48b7

Browse files
committed
---
yaml --- r: 194812 b: refs/heads/auto c: afaa3b6 h: refs/heads/master v: v3
1 parent 4fe4633 commit 17c48b7

38 files changed

+143
-707
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1010
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1111
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1212
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
13-
refs/heads/auto: e42521aa58be928dd62b5450c443368d29ab6a65
13+
refs/heads/auto: afaa3b6a2066e4dacd4e7dafb5fd911bf35bdd6c
1414
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1515
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1616
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/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/auto/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/auto/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/auto/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/auto/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/auto/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/auto/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/auto/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/auto/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/auto/src/librustc/session/config.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -604,8 +604,6 @@ options! {DebuggingOptions, DebuggingSetter, basic_debugging_options,
604604
"Print the size of enums and their variants"),
605605
force_overflow_checks: Option<bool> = (None, parse_opt_bool,
606606
"Force overflow checks on or off"),
607-
force_dropflag_checks: Option<bool> = (None, parse_opt_bool,
608-
"Force drop flag checks on or off"),
609607
}
610608

611609
pub fn default_lib_output() -> CrateType {

branches/auto/src/librustc_trans/trans/_match.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1528,7 +1528,7 @@ pub fn store_local<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
15281528
let scope = cleanup::var_scope(tcx, p_id);
15291529
bcx = mk_binding_alloca(
15301530
bcx, p_id, &path1.node, scope, (),
1531-
|(), bcx, llval, ty| { drop_done_fill_mem(bcx, llval, ty); bcx });
1531+
|(), bcx, llval, ty| { zero_mem(bcx, llval, ty); bcx });
15321532
});
15331533
bcx
15341534
}

0 commit comments

Comments
 (0)