rust/tests/ui/contracts/internal_machinery/contracts-lowering-ensures-is-not-inherited-when-nesting.rs
Felix S. Klock II 6a6c6b891b Separate contract feature gates for the internal machinery
The extended syntax for function signature that includes contract clauses
should never be user exposed versus the interface we want to ship
externally eventually.
2025-02-03 13:55:15 -08:00

15 lines
256 B
Rust

//@ run-pass
//@ compile-flags: -Zcontract-checks=yes
#![feature(rustc_contracts_internals)]
fn outer() -> i32
rustc_contract_ensures(|ret| *ret > 0)
{
let inner_closure = || -> i32 { 0 };
inner_closure();
10
}
fn main() {
outer();
}