Skip to content

Make the hermit target typecheck #78304

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions library/std/src/sys/hermit/mutex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ pub struct Mutex {
inner: *const c_void,
}

pub type MovableMutex = Box<Mutex>;

unsafe impl Send for Mutex {}
unsafe impl Sync for Mutex {}

Expand Down
29 changes: 25 additions & 4 deletions library/std/src/sys/hermit/process.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
use crate::ffi::OsStr;
use crate::ffi::{OsStr, OsString};
use crate::fmt;
use crate::io;
use crate::iter::Empty;
use crate::path::Path;
use crate::sys::fs::File;
use crate::sys::pipe::AnonPipe;
use crate::sys::{unsupported, Void};
use crate::sys_common::process::CommandEnv;
use crate::sys_common::process::{CommandEnv, CommandEnvs};

pub use crate::ffi::OsString as EnvKey;

Expand All @@ -13,9 +15,12 @@ pub use crate::ffi::OsString as EnvKey;
////////////////////////////////////////////////////////////////////////////////

pub struct Command {
program: OsString,
env: CommandEnv,
}

pub type CommandArgs<'a> = Empty<&'a OsStr>;

// passed back to std::process with the pipes connected to the child, if any
// were requested
pub struct StdioPipes {
Expand All @@ -31,8 +36,8 @@ pub enum Stdio {
}

impl Command {
pub fn new(_program: &OsStr) -> Command {
Command { env: Default::default() }
pub fn new(program: &OsStr) -> Command {
Command { program: program.into(), env: Default::default() }
}

pub fn arg(&mut self, _arg: &OsStr) {}
Expand All @@ -49,6 +54,22 @@ impl Command {

pub fn stderr(&mut self, _stderr: Stdio) {}

pub fn get_args(&self) -> CommandArgs<'_> {
Default::default()
}

pub fn get_current_dir(&self) -> Option<&Path> {
None
}

pub fn get_program(&self) -> &OsStr {
&self.program
}

pub fn get_envs(&self) -> CommandEnvs<'_> {
self.env.iter()
}

pub fn spawn(
&mut self,
_default: Stdio,
Expand Down