
Check ensures on early return due to Try / Yeet Expand these two expressions to include a call to contract checking
14 lines
247 B
Rust
14 lines
247 B
Rust
//@ run-pass
|
|
//@ compile-flags: -Zcontract-checks=yes
|
|
#![feature(rustc_contracts)]
|
|
|
|
#[core::contracts::ensures(|ret| *ret > 0)]
|
|
fn outer() -> i32 {
|
|
let inner_closure = || -> i32 { 0 };
|
|
inner_closure();
|
|
10
|
|
}
|
|
|
|
fn main() {
|
|
outer();
|
|
}
|