We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dc0bae1 commit f341db4Copy full SHA for f341db4
compiler/rustc_ast_lowering/src/item.rs
@@ -1188,7 +1188,9 @@ impl<'hir> LoweringContext<'_, 'hir> {
1188
// into:
1189
//
1190
// { contract_requires(PRECOND); let __postcond = |ret_val| POSTCOND; postcond({ body }) }
1191
- if let Some(contract) = contract {
+ if let Some(contract) = contract
1192
+ && this.tcx.sess.opts.unstable_opts.contract_checks == Some(true)
1193
+ {
1194
let precond = if let Some(req) = &contract.requires {
1195
// Lower the precondition check intrinsic.
1196
let lowered_req = this.lower_expr_mut(&req);
0 commit comments