Files
rust/compiler/rustc_ast/src/ptr.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

12 lines
331 B
Rust
Raw Normal View History

/// A pointer type that uniquely owns a heap allocation of type T.
///
/// This used to be its own type, but now it's just a typedef for `Box` and we are planning to
/// remove it soon.
pub type P<T> = Box<T>;
2014-05-20 00:12:17 +03:00
/// Construct a `P<T>` from a `T` value.
#[allow(non_snake_case)]
pub fn P<T>(value: T) -> P<T> {
Box::new(value)
}