Function rustc::ty::wf::obligations [] [src]

pub fn obligations<'a, 'gcx, 'tcx>(
    infcx: &InferCtxt<'a, 'gcx, 'tcx>,
    param_env: ParamEnv<'tcx>,
    body_id: NodeId,
    ty: Ty<'tcx>,
    span: Span
) -> Option<Vec<PredicateObligation<'tcx>>>
🔬 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?

Returns the set of obligations needed to make ty well-formed. If ty contains unresolved inference variables, this may include further WF obligations. However, if ty IS an unresolved inference variable, returns None, because we are not able to make any progress at all. This is to prevent "livelock" where we say "$0 is WF if $0 is WF".