about summary refs log tree commit diff
path: root/tests/ui/contracts/internal_machinery/contracts-lowering-ensures-is-not-inherited-when-nesting.rs
blob: 960ccaed3588a0f5eaa2f0f2ebfbef81cfb4aa41 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//@ run-pass
//@ compile-flags: -Zcontract-checks=yes
#![feature(contracts_internals)]

fn outer() -> i32
    contract_ensures(|ret| *ret > 0)
{
    let inner_closure = || -> i32 { 0 };
    inner_closure();
    10
}

fn main() {
    outer();
}