Trait OwnedHeapAnalysis

Source
pub trait OwnedHeapAnalysis: Analysis {
    // Required method
    fn get_all_items(&self) -> OHAResultMap;

    // Provided methods
    fn is_heapowner<'tcx>(
        hares: OHAResultMap,
        ty: Ty<'tcx>,
    ) -> Result<bool, &'static str> { ... }
    fn maybe_heapowner<'tcx>(
        hares: OHAResultMap,
        ty: Ty<'tcx>,
    ) -> Result<bool, &'static str> { ... }
}
Expand description

This trait provides features for owned heap analysis, which is used to determine if a type owns memory on heap. Owned heap should be automatically released by default.

Required Methods§

Source

fn get_all_items(&self) -> OHAResultMap

The function returns the result of owned heap analysis for all types.

Provided Methods§

Source

fn is_heapowner<'tcx>( hares: OHAResultMap, ty: Ty<'tcx>, ) -> Result<bool, &'static str>

If a type is a heap owner, the function returns Result. If the specified type is illegal, the function returns Err.

Source

fn maybe_heapowner<'tcx>( hares: OHAResultMap, ty: Ty<'tcx>, ) -> Result<bool, &'static str>

A type might be a heap owner if it is not a heap owner directly but contains type parameters that may make the type become a heap owner after monomorphization.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§