about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2022-10-26 09:48:47 +0200
committerRalf Jung <post@ralfj.de>2022-10-26 09:48:47 +0200
commit20ab57e582edc0a562a20f37700d0af90adcb10b (patch)
tree3a8c6c34f094cfa89f9451a030e20a2d32204e21
parenta5406feb1cf1a9f2479b72917cf4225e5f6aa240 (diff)
downloadrust-20ab57e582edc0a562a20f37700d0af90adcb10b.tar.gz
rust-20ab57e582edc0a562a20f37700d0af90adcb10b.zip
library: allow some unused things in Miri
-rw-r--r--library/std/src/sys/unix/fs.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/library/std/src/sys/unix/fs.rs b/library/std/src/sys/unix/fs.rs
index e22b2f3340a..37a49f2d78a 100644
--- a/library/std/src/sys/unix/fs.rs
+++ b/library/std/src/sys/unix/fs.rs
@@ -1,3 +1,6 @@
+// miri has some special hacks here that make things unused.
+#![cfg_attr(miri, allow(unused))]
+
 use crate::os::unix::prelude::*;
 
 use crate::ffi::{CStr, OsStr, OsString};
@@ -850,7 +853,6 @@ impl DirEntry {
         target_os = "fuchsia",
         target_os = "redox"
     )))]
-    #[cfg_attr(miri, allow(unused))]
     fn name_cstr(&self) -> &CStr {
         unsafe { CStr::from_ptr(self.entry.d_name.as_ptr()) }
     }
@@ -862,7 +864,6 @@ impl DirEntry {
         target_os = "fuchsia",
         target_os = "redox"
     ))]
-    #[cfg_attr(miri, allow(unused))]
     fn name_cstr(&self) -> &CStr {
         &self.name
     }