about summary refs log tree commit diff
path: root/library/std/src/sys
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2022-10-27 09:25:10 +0200
committerGitHub <noreply@github.com>2022-10-27 09:25:10 +0200
commit8a297844005b7152a8b9a9f7c6bcf557c4157ab3 (patch)
tree0fde6d3a9a2aac3dd41b35c6c74676eb494c8e68 /library/std/src/sys
parent2bd49c34e57d444bad1291d7e6146cc2f6409536 (diff)
parent20ab57e582edc0a562a20f37700d0af90adcb10b (diff)
downloadrust-8a297844005b7152a8b9a9f7c6bcf557c4157ab3.tar.gz
rust-8a297844005b7152a8b9a9f7c6bcf557c4157ab3.zip
Rollup merge of #103564 - RalfJung:miri-unused, r=thomcc
library: allow some unused things in Miri

Should help for https://github.com/rust-lang/rust/pull/102950.
Diffstat (limited to 'library/std/src/sys')
-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
     }