summary refs log tree commit diff
path: root/tests/ui/contracts/contracts-ensures-is-not-inherited-when-nesting.rs
blob: f01a852fbff344b66a5c66e3f3522af7bf734f52 (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)]
//~^ WARN the feature `contracts` is incomplete and may not be safe to use and/or cause compiler crashes [incomplete_features]

#[core::contracts::ensures(|ret| *ret > 0)]
fn outer() -> i32 {
    let inner_closure = || -> i32 { 0 };
    inner_closure();
    10
}

fn main() {
    outer();
}