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-08-20 19:45:11 +0200
committerGitHub <noreply@github.com>2022-08-20 19:45:11 +0200
commite93edf3335ef172274acb208d672db51d40eeb2f (patch)
treeb7c7cff9421c7a75c92d32e3bfaa1bb0b27eb8c1 /library/std/src/sys
parent8828af4d88f69a3fce63e7ea6420f3363127802c (diff)
parentfbcdf2a383f6b17f80d8c285af3fa9739aaf223c (diff)
downloadrust-e93edf3335ef172274acb208d672db51d40eeb2f.tar.gz
rust-e93edf3335ef172274acb208d672db51d40eeb2f.zip
Rollup merge of #100129 - RalfJung:miri-test-libstd, r=thomcc
add miri-test-libstd support to libstd

- The first commit mirrors what we already have in liballoc.
- The second commit adds some regression tests that only really make sense to be run in Miri, since they rely on Miri's extra checks to detect anything.
- The third commit makes the MPSC tests work in reasonable time in Miri by reducing iteration counts.
- The fourth commit silences some warnings due to code being disabled with `cfg(miri)`
Diffstat (limited to 'library/std/src/sys')
-rw-r--r--library/std/src/sys/unix/fs.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/library/std/src/sys/unix/fs.rs b/library/std/src/sys/unix/fs.rs
index 7778033eaa9..f38d2fd3d70 100644
--- a/library/std/src/sys/unix/fs.rs
+++ b/library/std/src/sys/unix/fs.rs
@@ -829,6 +829,7 @@ 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()) }
     }
@@ -840,6 +841,7 @@ impl DirEntry {
         target_os = "fuchsia",
         target_os = "redox"
     ))]
+    #[cfg_attr(miri, allow(unused))]
     fn name_cstr(&self) -> &CStr {
         &self.name
     }