rust/tests/ui/contracts/internal_machinery/contracts-lowering-ensures-is-not-inherited-when-nesting.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

16 lines
256 B
Rust
Raw Normal View History

//@ 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();
}