浏览代码

maps: Disable miri warnings about integer-to-pointer conversions

`override_syscall` performs integer-to-pointer conversion. This is
considered harmful on the newest Rust nightly which provides
`ptr::from_exposed_addr`, but there is no other way on Rust stable than
doing `as *const T`, which is what miri is unhappy about.

Signed-off-by: Michal Rostecki <[email protected]>
Michal Rostecki 2 年之前
父节点
当前提交
43aff57793
共有 1 个文件被更改,包括 24 次插入0 次删除
  1. 24 0
      aya/src/maps/hash_map/hash_map.rs

+ 24 - 0
aya/src/maps/hash_map/hash_map.rs

@@ -475,6 +475,10 @@ 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() {
         override_syscall(|call| match call {
             Syscall::Bpf {
@@ -497,6 +501,10 @@ 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() {
         override_syscall(|call| match call {
             Syscall::Bpf {
@@ -532,6 +540,10 @@ 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() {
         override_syscall(|call| match call {
             Syscall::Bpf {
@@ -556,6 +568,10 @@ 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() {
         override_syscall(|call| match call {
             Syscall::Bpf {
@@ -591,6 +607,10 @@ 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() {
         override_syscall(|call| match call {
             Syscall::Bpf {
@@ -632,6 +652,10 @@ 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() {
         override_syscall(|call| match call {
             Syscall::Bpf {