Remove a large amount of deprecated functionality
Spring cleaning is here! In the Fall! This commit removes quite a large amount of deprecated functionality from the standard libraries. I tried to ensure that only old deprecated functionality was removed. This is removing lots and lots of deprecated features, so this is a breaking change. Please consult the deprecation messages of the deleted code to see how to migrate code forward if it still needs migration. [breaking-change]
This commit is contained in:
@@ -37,6 +37,7 @@
|
||||
use std::fmt;
|
||||
use std::fmt::Show;
|
||||
use std::hash::Hash;
|
||||
use std::ptr;
|
||||
use serialize::{Encodable, Decodable, Encoder, Decoder};
|
||||
|
||||
/// An owned smart pointer.
|
||||
@@ -61,11 +62,10 @@ impl<T: 'static> P<T> {
|
||||
|
||||
/// Transform the inner value, consuming `self` and producing a new `P<T>`.
|
||||
pub fn map(mut self, f: |T| -> T) -> P<T> {
|
||||
use std::{mem, ptr};
|
||||
unsafe {
|
||||
let p = &mut *self.ptr;
|
||||
// FIXME(#5016) this shouldn't need to zero to be safe.
|
||||
mem::move_val_init(p, f(ptr::read_and_zero(p)));
|
||||
ptr::write(p, f(ptr::read_and_zero(p)));
|
||||
}
|
||||
self
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user