syntax: add a custom owned smart pointer in ptr::P.

This commit is contained in:
Eduard Burtescu
2014-05-18 00:46:40 +03:00
parent 79a5448f41
commit 1872c4c6b5
3 changed files with 82 additions and 10 deletions

View File

@@ -25,16 +25,6 @@ use std::rc::Rc;
use std::gc::{Gc, GC};
use serialize::{Encodable, Decodable, Encoder, Decoder};
/// A pointer abstraction.
// FIXME(eddyb) #10676 use Rc<T> in the future.
pub type P<T> = Gc<T>;
#[allow(non_snake_case)]
/// Construct a P<T> from a T value.
pub fn P<T: 'static>(value: T) -> P<T> {
box(GC) value
}
// FIXME #6993: in librustc, uses of "ident" should be replaced
// by just "Name".