2024-12-03 02:52:29 +00:00
|
|
|
//@ run-pass
|
|
|
|
//@ compile-flags: -Zcontract-checks=yes
|
2025-01-30 17:06:09 -08:00
|
|
|
#![feature(contracts)]
|
|
|
|
//~^ WARN the feature `contracts` is incomplete and may not be safe to use and/or cause compiler crashes [incomplete_features]
|
2024-12-03 02:52:29 +00:00
|
|
|
|
|
|
|
#[core::contracts::ensures(|ret| *ret > 0)]
|
|
|
|
fn outer() -> i32 {
|
|
|
|
let inner_closure = || -> i32 { 0 };
|
|
|
|
inner_closure();
|
|
|
|
10
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
outer();
|
|
|
|
}
|