about summary refs log tree commit diff
path: root/tests/ui/feature-gates/feature-gate-contracts.rs
blob: 1759d23077b538cfe0ac9aff512abd2f15b5f282 (plain)
1
2
3
4
5
6
7
8
9
#![crate_type = "lib"]

#[core::contracts::requires(x > 0)]
pub fn requires_needs_it(x: i32) { }
//~^^  ERROR use of unstable library feature `contracts`

#[core::contracts::ensures(|ret| *ret > 0)]
pub fn ensures_needs_it() -> i32 { 10 }
//~^^  ERROR use of unstable library feature `contracts`