From ab3339a534bc8055d30cbcb445e9008ef2048bd9 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Wed, 26 Oct 2022 09:48:47 +0200 Subject: [PATCH] library: allow some unused things in Miri --- std/src/sys/unix/fs.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/std/src/sys/unix/fs.rs b/std/src/sys/unix/fs.rs index e22b2f334..37a49f2d7 100644 --- a/std/src/sys/unix/fs.rs +++ b/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 }