2025-01-30 17:06:09 -08:00
|
|
|
// gate-test-contracts_internals
|
2024-12-03 16:13:00 +00:00
|
|
|
|
|
|
|
|
fn main() {
|
2025-01-30 17:06:09 -08:00
|
|
|
// intrinsics are guarded by contracts_internals feature gate.
|
2024-12-03 16:13:00 +00:00
|
|
|
core::intrinsics::contract_checks();
|
2025-01-30 17:06:09 -08:00
|
|
|
//~^ ERROR use of unstable library feature `contracts_internals`
|
2024-12-03 16:13:00 +00:00
|
|
|
core::intrinsics::contract_check_requires(|| true);
|
2025-01-30 17:06:09 -08:00
|
|
|
//~^ ERROR use of unstable library feature `contracts_internals`
|
2025-04-07 17:42:08 -07:00
|
|
|
core::intrinsics::contract_check_ensures( |_|true, &1);
|
2025-01-30 17:06:09 -08:00
|
|
|
//~^ ERROR use of unstable library feature `contracts_internals`
|
2024-12-03 16:13:00 +00:00
|
|
|
|
|
|
|
|
core::contracts::build_check_ensures(|_: &()| true);
|
2025-01-30 17:06:09 -08:00
|
|
|
//~^ ERROR use of unstable library feature `contracts_internals`
|
2024-12-03 16:13:00 +00:00
|
|
|
|
2025-01-30 17:06:09 -08:00
|
|
|
// ast extensions are guarded by contracts_internals feature gate
|
|
|
|
|
fn identity_1() -> i32 contract_requires(|| true) { 10 }
|
2024-12-03 16:13:00 +00:00
|
|
|
//~^ ERROR contract internal machinery is for internal use only
|
2025-01-30 17:06:09 -08:00
|
|
|
fn identity_2() -> i32 contract_ensures(|_| true) { 10 }
|
2024-12-03 16:13:00 +00:00
|
|
|
//~^ ERROR contract internal machinery is for internal use only
|
|
|
|
|
}
|