Module contracts

Source
🔬This is a nightly-only experimental API. (contracts)
Expand description

Unstable module containing the unstable contracts lang items and attribute macros.

Functions§

build_check_ensuresExperimental
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).

Attribute Macros§

ensuresExperimental
Attribute macro applied to a function to give it a post-condition.
requiresExperimental
Attribute macro applied to a function to give it a precondition.