Skip to content

Commit e411051

Browse files
add target_arch cfg
1 parent fac264f commit e411051

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

library/core/src/ffi/c_str.rs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -891,7 +891,8 @@ mod verify {
891891

892892
// pub const fn from_bytes_until_nul(bytes: &[u8]) -> Result<&CStr, FromBytesUntilNulError>
893893
#[kani::proof]
894-
#[kani::solver(cvc5)] // 7.3 seconds when 16; 33.1 seconds when 32
894+
#[kani::solver(cvc5)]
895+
#[cfg(not(all(target_arch = "x86_64", target_feature = "sse2")))]
895896
fn check_from_bytes_until_nul() {
896897
const MAX_SIZE: usize = 32;
897898
let string: [u8; MAX_SIZE] = kani::any();
@@ -927,6 +928,7 @@ mod verify {
927928
// pub fn bytes(&self) -> Bytes<'_>
928929
#[kani::proof]
929930
#[kani::solver(cvc5)]
931+
#[cfg(not(all(target_arch = "x86_64", target_feature = "sse2")))]
930932
fn check_bytes() {
931933
const MAX_SIZE: usize = 32;
932934
let string: [u8; MAX_SIZE] = kani::any();
@@ -945,6 +947,7 @@ mod verify {
945947
// pub const fn to_str(&self) -> Result<&str, str::Utf8Error>
946948
#[kani::proof]
947949
#[kani::solver(cvc5)]
950+
#[cfg(not(all(target_arch = "x86_64", target_feature = "sse2")))]
948951
fn check_to_str() {
949952
const MAX_SIZE: usize = 32;
950953
let string: [u8; MAX_SIZE] = kani::any();
@@ -962,6 +965,7 @@ mod verify {
962965
// pub const fn as_ptr(&self) -> *const c_char
963966
#[kani::proof]
964967
#[kani::solver(cvc5)]
968+
#[cfg(not(all(target_arch = "x86_64", target_feature = "sse2")))]
965969
fn check_as_ptr() {
966970
const MAX_SIZE: usize = 32;
967971
let string: [u8; MAX_SIZE] = kani::any();
@@ -989,6 +993,7 @@ mod verify {
989993
// pub const fn from_bytes_with_nul(bytes: &[u8]) -> Result<&Self, FromBytesWithNulError>
990994
#[kani::proof]
991995
#[kani::solver(cvc5)]
996+
#[cfg(not(all(target_arch = "x86_64", target_feature = "sse2")))]
992997
fn check_from_bytes_with_nul() {
993998
const MAX_SIZE: usize = 16;
994999
let string: [u8; MAX_SIZE] = kani::any();
@@ -1003,6 +1008,7 @@ mod verify {
10031008
// pub const fn count_bytes(&self) -> usize
10041009
#[kani::proof]
10051010
#[kani::solver(cvc5)]
1011+
#[cfg(not(all(target_arch = "x86_64", target_feature = "sse2")))]
10061012
fn check_count_bytes() {
10071013
const MAX_SIZE: usize = 32;
10081014
let mut bytes: [u8; MAX_SIZE] = kani::any();
@@ -1028,6 +1034,7 @@ mod verify {
10281034
// pub const fn to_bytes(&self) -> &[u8]
10291035
#[kani::proof]
10301036
#[kani::solver(cvc5)]
1037+
#[cfg(not(all(target_arch = "x86_64", target_feature = "sse2")))]
10311038
fn check_to_bytes() {
10321039
const MAX_SIZE: usize = 32;
10331040
let string: [u8; MAX_SIZE] = kani::any();
@@ -1044,6 +1051,7 @@ mod verify {
10441051
// pub const fn to_bytes_with_nul(&self) -> &[u8]
10451052
#[kani::proof]
10461053
#[kani::solver(cvc5)]
1054+
#[cfg(not(all(target_arch = "x86_64", target_feature = "sse2")))]
10471055
fn check_to_bytes_with_nul() {
10481056
const MAX_SIZE: usize = 32;
10491057
let string: [u8; MAX_SIZE] = kani::any();
@@ -1060,6 +1068,7 @@ mod verify {
10601068
// const unsafe fn strlen(ptr: *const c_char) -> usize
10611069
#[kani::proof_for_contract(super::strlen)]
10621070
#[kani::solver(cvc5)]
1071+
#[cfg(not(all(target_arch = "x86_64", target_feature = "sse2")))]
10631072
fn check_strlen_contract() {
10641073
const MAX_SIZE: usize = 32;
10651074
let mut string: [u8; MAX_SIZE] = kani::any();
@@ -1073,6 +1082,7 @@ mod verify {
10731082
// pub const unsafe fn from_ptr<'a>(ptr: *const c_char) -> &'a CStr
10741083
#[kani::proof_for_contract(CStr::from_ptr)]
10751084
#[kani::solver(cvc5)]
1085+
#[cfg(not(all(target_arch = "x86_64", target_feature = "sse2")))]
10761086
fn check_from_ptr_contract() {
10771087
const MAX_SIZE: usize = 32;
10781088
let string: [u8; MAX_SIZE] = kani::any();
@@ -1086,6 +1096,7 @@ mod verify {
10861096
// pub const fn is_empty(&self) -> bool
10871097
#[kani::proof]
10881098
#[kani::solver(cvc5)]
1099+
#[cfg(not(all(target_arch = "x86_64", target_feature = "sse2")))]
10891100
fn check_is_empty() {
10901101
const MAX_SIZE: usize = 32;
10911102
let string: [u8; MAX_SIZE] = kani::any();

0 commit comments

Comments
 (0)