Function rustc::traits::query::dropck_outlives::trivial_dropck_outlives[][src]

fn trivial_dropck_outlives<'cx, 'tcx>(
    tcx: TyCtxt<'cx, '_, 'tcx>,
    ty: Ty<'tcx>
) -> bool
🔬 This is a nightly-only experimental API. (rustc_private)

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

This returns true if the type ty is "trivial" for dropck-outlives -- that is, if it doesn't require any types to outlive. This is similar but not quite the same as the needs_drop test in the compiler already -- that is, for every type T for which this function return true, needs-drop would return false. But the reverse does not hold: in particular, needs_drop returns false for PhantomData, but it is not trivial for dropck-outlives.

Note also that needs_drop requires a "global" type (i.e., one with erased regions), but this funtcion does not.