From a1fc71ab1fd7cfab271d658d87e3715b54f4efc2 Mon Sep 17 00:00:00 2001 From: coord_e Date: Sun, 5 Jul 2026 11:22:48 +0900 Subject: [PATCH] Return false for zero in i32::{is_positive,is_negative} specs --- std.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/std.rs b/std.rs index 4d6cd8b6..105c8807 100644 --- a/std.rs +++ b/std.rs @@ -705,14 +705,14 @@ fn _extern_spec_i32_signum(x: i32) -> i32 { #[thrust::extern_spec_fn] #[thrust_macros::requires(true)] -#[thrust_macros::ensures((x < 0 && result == false) || (x >= 0 && result == true))] +#[thrust_macros::ensures((x <= 0 && result == false) || (x > 0 && result == true))] fn _extern_spec_i32_is_positive(x: i32) -> bool { i32::is_positive(x) } #[thrust::extern_spec_fn] #[thrust_macros::requires(true)] -#[thrust_macros::ensures((x <= 0 && result == true) || (x > 0 && result == false))] +#[thrust_macros::ensures((x < 0 && result == true) || (x >= 0 && result == false))] fn _extern_spec_i32_is_negative(x: i32) -> bool { i32::is_negative(x) }