diff options
| author | bors <bors@rust-lang.org> | 2019-11-30 02:12:19 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2019-11-30 02:12:19 +0000 |
| commit | 8f1bbd69e13c9e04a4c2b75612bc0c31af972439 (patch) | |
| tree | 9b0910367b9d14862d21fdb1bc21bc45a79f955c /src/libstd/sys | |
| parent | 9081929d45f12d3f56d43b1d6db7519981580fc9 (diff) | |
| parent | f621c252ec82baae0b81a03b4e5b7a59703ffcee (diff) | |
| download | rust-8f1bbd69e13c9e04a4c2b75612bc0c31af972439.tar.gz rust-8f1bbd69e13c9e04a4c2b75612bc0c31af972439.zip | |
Auto merge of #66873 - RalfJung:miri-args, r=dtolnay
really_init cmdline args on Miri r? @joshtriplett Closes #66862.
Diffstat (limited to 'src/libstd/sys')
| -rw-r--r-- | src/libstd/sys/unix/args.rs | 8 |
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); } |
