about summary refs log tree commit diff
path: root/compiler/rustc_ast/src/ptr.rs
blob: fffeab8bbca66869753cfb1843b2ae76462d2180 (plain)
1
2
3
4
5
6
7
8
9
10
11
/// 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>;

/// Construct a `P<T>` from a `T` value.
#[allow(non_snake_case)]
pub fn P<T>(value: T) -> P<T> {
    Box::new(value)
}