about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2019-11-29 20:07:55 +0100
committerRalf Jung <post@ralfj.de>2019-11-29 20:07:55 +0100
commitf621c252ec82baae0b81a03b4e5b7a59703ffcee (patch)
treef4e64afe9085f7662985f19a930784a0da5bd842 /src/libstd
parentd99e0c6d02b159f305474f58c8c38027bb06e051 (diff)
downloadrust-f621c252ec82baae0b81a03b4e5b7a59703ffcee.tar.gz
rust-f621c252ec82baae0b81a03b4e5b7a59703ffcee.zip
really_init cmdline args on Miri
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/sys/unix/args.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/libstd/sys/unix/args.rs b/src/libstd/sys/unix/args.rs
index 15dafb1bcf9..2ed1585395e 100644
--- a/src/libstd/sys/unix/args.rs
+++ b/src/libstd/sys/unix/args.rs
@@ -80,7 +80,13 @@ mod imp {
 
     #[inline(always)]
     pub unsafe fn init(_argc: isize, _argv: *const *const u8) {
-        #[cfg(not(all(target_os = "linux", target_env = "gnu")))]
+        // On Linux-GNU, we rely on `ARGV_INIT_ARRAY` below to initialize
+        // `ARGC` and `ARGV`. But in Miri that does not actually happen so we
+        // still initialize here.
+        #[cfg(any(
+            miri,
+            not(all(target_os = "linux", target_env = "gnu"))
+        ))]
         really_init(_argc, _argv);
     }