Files
rust/compiler/rustc_ast/src/ptr.rs
Nicholas Nethercote 991c91fdaa Reduce P<T> to a typedef of Box<T>.
Keep the `P` constructor function for now, to minimize immediate churn.

All the `into_inner` calls are removed, which is nice.
2025-05-27 13:29:24 +10:00

12 lines
331 B
Rust

/// 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)
}