Function build_check_ensures

Source
pub fn build_check_ensures<Ret, C>(cond: C) -> impl Fn(Ret) + Copy
where C: for<'a> Fn(&'a Ret) -> bool + Copy + 'static,
🔬This is a nightly-only experimental API. (contracts_internals)
Expand description

Emitted by rustc as a desugaring of #[ensures(PRED)] fn foo() -> R { ... [return R;] ... } into: fn foo() { let _check = build_check_ensures(|ret| PRED) ... [return _check(R);] ... } (including the implicit return of the tail expression, if any).