]> git.proxmox.com Git - rustc.git/blobdiff - library/std/src/sys/wasi/args.rs
New upstream version 1.53.0+dfsg1
[rustc.git] / library / std / src / sys / wasi / args.rs
index 9a27218e1fb70cb2510b36260277d8f7497ad81a..c42c310e3a254f934b15cbc8e464e53f218e612b 100644 (file)
@@ -1,25 +1,20 @@
 #![deny(unsafe_op_in_unsafe_fn)]
 
 use crate::ffi::{CStr, OsStr, OsString};
-use crate::marker::PhantomData;
+use crate::fmt;
 use crate::os::wasi::ffi::OsStrExt;
 use crate::vec;
 
-pub unsafe fn init(_argc: isize, _argv: *const *const u8) {}
-
-pub unsafe fn cleanup() {}
-
 pub struct Args {
     iter: vec::IntoIter<OsString>,
-    _dont_send_or_sync_me: PhantomData<*mut ()>,
 }
 
+impl !Send for Args {}
+impl !Sync for Args {}
+
 /// Returns the command line arguments
 pub fn args() -> Args {
-    Args {
-        iter: maybe_args().unwrap_or(Vec::new()).into_iter(),
-        _dont_send_or_sync_me: PhantomData,
-    }
+    Args { iter: maybe_args().unwrap_or(Vec::new()).into_iter() }
 }
 
 fn maybe_args() -> Option<Vec<OsString>> {
@@ -38,9 +33,9 @@ fn maybe_args() -> Option<Vec<OsString>> {
     }
 }
 
-impl Args {
-    pub fn inner_debug(&self) -> &[OsString] {
-        self.iter.as_slice()
+impl fmt::Debug for Args {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+        self.iter.as_slice().fmt(f)
     }
 }