Desugars contract into the internal AST extensions
Check ensures on early return due to Try / Yeet Expand these two expressions to include a call to contract checking
This commit is contained in:
committed by
Celina G. Val
parent
38eff16d0a
commit
ae7eff0be5
@@ -1,5 +1,10 @@
|
||||
//! Unstable module containing the unstable contracts lang items and attribute macros.
|
||||
|
||||
#[cfg(not(bootstrap))]
|
||||
pub use crate::macros::builtin::contracts_ensures as ensures;
|
||||
#[cfg(not(bootstrap))]
|
||||
pub use crate::macros::builtin::contracts_requires as requires;
|
||||
|
||||
/// Emitted by rustc as a desugaring of `#[requires(PRED)] fn foo(x: X) { ... }`
|
||||
/// into: `fn foo(x: X) { check_requires(|| PRED) ... }`
|
||||
#[cfg(not(bootstrap))]
|
||||
|
||||
Reference in New Issue
Block a user