From cb6d3bd75d162e4928fdf4daa7f515e1ad85ae85 Mon Sep 17 00:00:00 2001 From: Tamir Duberstein Date: Thu, 2 May 2024 09:34:57 -0400 Subject: [PATCH] Remove miri ignores These only warn now: ``` test maps::hash_map::hash_map::tests::test_iter ... warning: integer-to-pointer cast --> aya/src/maps/hash_map/hash_map.rs:304:15 | 304 | match unsafe { attr.__bindgen_anon_2.key } as *const T { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ integer-to-pointer cast | = help: This program is using integer-to-pointer casts or (equivalently) `ptr::with_exposed_provenance`, = help: which means that Miri might miss pointer bugs in this program. = help: See https://doc.rust-lang.org/nightly/std/ptr/fn.with_exposed_provenance.html for more details on that operation. = help: To ensure that Miri does not miss bugs in your program, use Strict Provenance APIs (https://doc.rust-lang.org/nightly/std/ptr/index.html#strict-provenance, https://crates.io/crates/sptr) instead. = help: You can then pass the `-Zmiri-strict-provenance` flag to Miri, to ensure you are not relying on `with_exposed_provenance` semantics. = help: Alternatively, the `-Zmiri-permissive-provenance` flag disables this warning. = note: BACKTRACE on thread `maps::hash_map:`: = note: inside `maps::hash_map::hash_map::tests::bpf_key::` at aya/src/maps/hash_map/hash_map.rs:304:15: 304:63 ``` --- aya/src/maps/hash_map/hash_map.rs | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/aya/src/maps/hash_map/hash_map.rs b/aya/src/maps/hash_map/hash_map.rs index a201ac37..307d1a51 100644 --- a/aya/src/maps/hash_map/hash_map.rs +++ b/aya/src/maps/hash_map/hash_map.rs @@ -357,10 +357,6 @@ mod tests { } #[test] - // Syscall overrides are performing integer-to-pointer conversions, which - // should be done with `ptr::from_exposed_addr` in Rust nightly, but we have - // to support stable as well. - #[cfg_attr(miri, ignore)] fn test_keys() { let map = new_map(new_obj_map()); @@ -379,10 +375,6 @@ mod tests { } #[test] - // Syscall overrides are performing integer-to-pointer conversions, which - // should be done with `ptr::from_exposed_addr` in Rust nightly, but we have - // to support stable as well. - #[cfg_attr(miri, ignore)] fn test_keys_error() { let map = new_map(new_obj_map()); override_syscall(|call| match call { @@ -416,10 +408,6 @@ mod tests { } #[test] - // Syscall overrides are performing integer-to-pointer conversions, which - // should be done with `ptr::from_exposed_addr` in Rust nightly, but we have - // to support stable as well. - #[cfg_attr(miri, ignore)] fn test_iter() { let map = new_map(new_obj_map()); override_syscall(|call| match call { @@ -439,10 +427,6 @@ mod tests { } #[test] - // Syscall overrides are performing integer-to-pointer conversions, which - // should be done with `ptr::from_exposed_addr` in Rust nightly, but we have - // to support stable as well. - #[cfg_attr(miri, ignore)] fn test_iter_key_deleted() { let map = new_map(new_obj_map()); override_syscall(|call| match call { @@ -473,10 +457,6 @@ mod tests { } #[test] - // Syscall overrides are performing integer-to-pointer conversions, which - // should be done with `ptr::from_exposed_addr` in Rust nightly, but we have - // to support stable as well. - #[cfg_attr(miri, ignore)] fn test_iter_key_error() { let map = new_map(new_obj_map()); override_syscall(|call| match call { @@ -516,10 +496,6 @@ mod tests { } #[test] - // Syscall overrides are performing integer-to-pointer conversions, which - // should be done with `ptr::from_exposed_addr` in Rust nightly, but we have - // to support stable as well. - #[cfg_attr(miri, ignore)] fn test_iter_value_error() { let map = new_map(new_obj_map()); override_syscall(|call| match call {