diff --git a/.cargo/config.toml b/.cargo/config.toml index 93ff01ac4e8..7434b905168 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -2,6 +2,8 @@ # like e.g. out-of-tree builds ( https://github.com/rust-lang/cargo/issues/2930 ). # For this reason this file should be avoided as much as possible when there are alternatives. +[target.i586-unknown-redox] +linker = "i586-unknown-redox-gcc" [target.x86_64-unknown-redox] linker = "x86_64-unknown-redox-gcc" [target.aarch64-unknown-linux-gnu] diff --git a/tests/by-util/test_test.rs b/tests/by-util/test_test.rs index 08675961896..2d2e8a4c5ae 100644 --- a/tests/by-util/test_test.rs +++ b/tests/by-util/test_test.rs @@ -634,11 +634,8 @@ fn test_file_is_not_executable() { use std::os::unix::fs::PermissionsExt; let metadata = std::fs::metadata(at.plus("regular_file")).unwrap(); let mut permissions = metadata.permissions(); - - // The conversion is useless on some platforms and casts from u16 to - // u32 on others - #[allow(clippy::useless_conversion)] - permissions.set_mode(permissions.mode() & !u32::from(libc::S_IXUSR)); + #[allow(clippy::unnecessary_cast)] + permissions.set_mode(permissions.mode() & !(libc::S_IXUSR as u32)); std::fs::set_permissions(at.plus("regular_file"), permissions).unwrap(); } ucmd.args(&["!", "-x", "regular_file"]).succeeds(); diff --git a/tests/uutests/src/lib/util.rs b/tests/uutests/src/lib/util.rs index bc04d459573..485026a8d4f 100644 --- a/tests/uutests/src/lib/util.rs +++ b/tests/uutests/src/lib/util.rs @@ -17,7 +17,7 @@ use core::str; #[cfg(unix)] use libc::mode_t; -#[cfg(unix)] +#[cfg(all(unix, not(target_os = "redox")))] use nix::pty::OpenptyResult; #[cfg(unix)] use nix::sys; @@ -1958,9 +1958,9 @@ impl UCommand { let mut captured_stdout = None; let mut captured_stderr = None; - #[cfg(unix)] + #[cfg(all(unix, not(target_os = "redox")))] let mut stdin_pty: Option = None; - #[cfg(not(unix))] + #[cfg(not(all(unix, not(target_os = "redox"))))] let stdin_pty: Option = None; if self.stderr_to_stdout { let mut output = CapturedOutput::default(); @@ -1995,7 +1995,7 @@ impl UCommand { .stderr(stderr); } - #[cfg(unix)] + #[cfg(all(unix, not(target_os = "redox")))] if let Some(simulated_terminal) = &self.terminal_simulation { let terminal_size = simulated_terminal.size.unwrap_or(libc::winsize { ws_col: 80, @@ -3002,7 +3002,7 @@ pub fn whoami() -> String { /// - path: The filesystem path to the PTY replica device /// - controller: The controller file /// - replica: The replica file -#[cfg(unix)] +#[cfg(all(unix, not(target_os = "redox")))] pub fn pty_path() -> (String, File, File) { use nix::pty::openpty; use nix::unistd::ttyname;