diff --git a/Cargo.lock b/Cargo.lock index a06fde6..ce62b90 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -49,12 +49,12 @@ dependencies = [ [[package]] name = "anstyle-wincon" -version = "3.0.7" +version = "3.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3534e77181a9cc07539ad51f2141fe32f6c3ffd4df76db8ad92346b003ae4e" +checksum = "6680de5231bd6ee4c6191b8a1325daa282b415391ec9d3a37bd34f2060dc73fa" dependencies = [ "anstyle", - "once_cell", + "once_cell_polyfill", "windows-sys", ] @@ -72,9 +72,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.9.0" +version = "2.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd" +checksum = "1b8e56985ec62d17e9c1001dc89c88ecd7dc08e47eba5ec7c29c7b5eeecde967" [[package]] name = "bitstruct" @@ -101,7 +101,7 @@ name = "bldb" version = "0.1.0" dependencies = [ "bit_field", - "bitflags 2.9.0", + "bitflags 2.9.1", "bitstruct", "cpio_reader", "goblin", @@ -139,9 +139,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.5.37" +version = "4.5.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eccb054f56cbd38340b380d4a8e69ef1f02f1af43db2f0cc817a4774d80ae071" +checksum = "ed93b9805f8ba930df42c2590f05453d5ec36cbb85d018868a5b24d31f6ac000" dependencies = [ "clap_builder", "clap_derive", @@ -149,9 +149,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.37" +version = "4.5.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efd9466fac8543255d3b1fcad4762c5e116ffe808c8a3043d4263cd4fd4862a2" +checksum = "379026ff283facf611b0ea629334361c4211d1b12ee01024eec1591133b04120" dependencies = [ "anstream", "anstyle", @@ -168,7 +168,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.100", + "syn 2.0.101", ] [[package]] @@ -185,11 +185,11 @@ checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" [[package]] name = "cpio_reader" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "625db7965478dc700951b2e15e9144863a0dacb31f60b0eb799c7a7b975afb5c" +checksum = "5793d74f50cf1460a969f028d40963d8d6e01ebae049dea976e944335c7df492" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.9.1", ] [[package]] @@ -203,9 +203,9 @@ dependencies = [ [[package]] name = "crc" -version = "3.2.1" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69e6e4d7b33a94f0991c26729976b10ebde1d34c3ee82408fb536164fa10d636" +checksum = "9710d3b3739c2e349eb44fe848ad0b7c8cb1e42bd87ee49371df2f7acaf3e675" dependencies = [ "crc-catalog", ] @@ -244,14 +244,14 @@ dependencies = [ [[package]] name = "duct" -version = "0.13.7" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4ab5718d1224b63252cd0c6f74f6480f9ffeb117438a2e0f5cf6d9a4798929c" +checksum = "b6ce170a0e8454fa0f9b0e5ca38a6ba17ed76a50916839d217eb5357e05cdfde" dependencies = [ "libc", - "once_cell", "os_pipe", "shared_child", + "shared_thread", ] [[package]] @@ -352,16 +352,16 @@ dependencies = [ ] [[package]] -name = "once_cell" -version = "1.21.3" +name = "once_cell_polyfill" +version = "1.70.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" +checksum = "a4895175b425cb1f87721b59f0f286c2092bd4af812243672510e1ac53e2e0ad" [[package]] name = "os_pipe" -version = "1.2.1" +version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ffd2b0a5634335b135d5728d84c5e0fd726954b87111f7506a61c502280d982" +checksum = "db335f4760b14ead6290116f2427bf33a14d4f0617d49f78a246de10c1831224" dependencies = [ "libc", "windows-sys", @@ -402,9 +402,9 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.20" +version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eded382c5f5f786b989652c49544c4877d9f015cc22e145a5ea8ea66c2921cd2" +checksum = "8a0d197bd2c9dc6e53b84da9556a69ba4cdfab8619eb41a8bd1cc2027a0f6b1d" [[package]] name = "scroll" @@ -423,7 +423,7 @@ checksum = "1783eabc414609e28a5ba76aee5ddd52199f7107a0b24c2e9746a1ecc34a683d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.100", + "syn 2.0.101", ] [[package]] @@ -434,9 +434,9 @@ checksum = "1bc711410fbe7399f390ca1c3b60ad0f53f80e95c5eb935e52268a0e2cd49acc" [[package]] name = "sha2" -version = "0.10.8" +version = "0.10.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" dependencies = [ "cfg-if", "cpufeatures", @@ -445,14 +445,20 @@ dependencies = [ [[package]] name = "shared_child" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09fa9338aed9a1df411814a5b2252f7cd206c55ae9bf2fa763f8de84603aa60c" +checksum = "7e297bd52991bbe0686c086957bee142f13df85d1e79b0b21630a99d374ae9dc" dependencies = [ "libc", "windows-sys", ] +[[package]] +name = "shared_thread" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7a6f98357c6bb0ebace19b22220e5543801d9de90ffe77f8abb27c056bac064" + [[package]] name = "spin" version = "0.9.8" @@ -502,7 +508,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.100", + "syn 2.0.101", ] [[package]] @@ -518,9 +524,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.100" +version = "2.0.101" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b09a44accad81e1ba1cd74a32461ba89dee89095ba17b32f5d03683b1b1fc2a0" +checksum = "8ce2b7fc941b3a24138a0a7cf8e858bfc6a992e7978a068a5c760deb0ed43caf" dependencies = [ "proc-macro2", "quote", @@ -661,9 +667,9 @@ dependencies = [ [[package]] name = "zmodem2" version = "0.1.2" -source = "git+https://github.com/oxidecomputer/zmodem2?branch=nostd#b06f75ef0a64b7a802706bf815ee187ca6ef157f" +source = "git+https://github.com/oxidecomputer/zmodem2#f3c1d8422c6356f51131d8ced7502e44fc9153d4" dependencies = [ - "bitflags 2.9.0", + "bitflags 2.9.1", "crc", "heapless", "hex", diff --git a/Cargo.toml b/Cargo.toml index d795451..20bc2ff 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -43,7 +43,7 @@ spin = { version = "0.10.0", default-features = false, features = [ static_assertions = "1.1" x86 = "0.52" xmodem = { git = "https://github.com/oxidecomputer/xmodem.rs", default-features = false } -zmodem2 = { git = "https://github.com/oxidecomputer/zmodem2", branch = "nostd", default-features = false } +zmodem2 = { git = "https://github.com/oxidecomputer/zmodem2", default-features = false } [profile.dev] panic = "abort" diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 87858dd..6cdd5c1 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "nightly-2025-04-22" +channel = "nightly-2025-05-23" components = [ "rustfmt", "rust-src", "llvm-tools", "clippy", "miri", "rust-analyzer" ] diff --git a/src/allocator.rs b/src/allocator.rs index 6df0fcf..00b25c7 100644 --- a/src/allocator.rs +++ b/src/allocator.rs @@ -111,6 +111,11 @@ impl BumpAlloc { /// Attempts to allocate a region of memory of the given /// alignment and size. + /// + /// Note that allocators are an explicit example of a use + /// case where the clippy `mut_from_ref` lint gives false + /// positives. + #[allow(clippy::mut_from_ref)] pub(crate) fn alloc_bytes( &self, align: usize, diff --git a/src/clock.rs b/src/clock.rs index e013272..8d60a7b 100644 --- a/src/clock.rs +++ b/src/clock.rs @@ -12,13 +12,13 @@ pub const NANOS_PER_SEC: u128 = 1_000_000_000; /// Returns the clock frequency of the current CPU in Hertz. pub fn frequency() -> u128 { const DEFAULT_HZ: u128 = 2_000_000_000; - if let Some(tsc_info) = cpuid::tscinfo() { - if tsc_info.nominal_frequency() != 0 { - return tsc_info - .tsc_frequency() - .map(|freq| freq.into()) - .unwrap_or(DEFAULT_HZ); - } + if let Some(tsc_info) = cpuid::tscinfo() + && tsc_info.nominal_frequency() != 0 + { + return tsc_info + .tsc_frequency() + .map(|freq| freq.into()) + .unwrap_or(DEFAULT_HZ); } DEFAULT_HZ } diff --git a/src/cpio.rs b/src/cpio.rs index 391d00a..e335020 100644 --- a/src/cpio.rs +++ b/src/cpio.rs @@ -114,15 +114,12 @@ fn print_mode(mode: cpio_reader::Mode) { let alt = |bit, t, f| { if mode.contains(bit) { t } else { f } }; - // For some reason, the cpio reader library appears to have - // the meaning of these bits mirrored with respect to the owner - // bits. - print!("{}", alt(Mode::WORLD_READABLE, 'r', '-')); - print!("{}", alt(Mode::WORLD_WRITABLE, 'w', '-')); + print!("{}", alt(Mode::USER_READABLE, 'r', '-')); + print!("{}", alt(Mode::USER_WRITABLE, 'w', '-')); if !mode.contains(Mode::SUID) { - print!("{}", alt(Mode::WORLD_EXECUTABLE, 'x', '-')); + print!("{}", alt(Mode::USER_EXECUTABLE, 'x', '-')); } else { - print!("{}", alt(Mode::WORLD_EXECUTABLE, 's', 'S')); + print!("{}", alt(Mode::USER_EXECUTABLE, 's', 'S')); } print!("{}", alt(Mode::GROUP_READABLE, 'r', '-')); @@ -133,11 +130,11 @@ fn print_mode(mode: cpio_reader::Mode) { print!("{}", alt(Mode::GROUP_EXECUTABLE, 's', 'S')); } - print!("{}", alt(Mode::USER_READABLE, 'r', '-')); - print!("{}", alt(Mode::USER_WRITABLE, 'w', '-')); + print!("{}", alt(Mode::WORLD_READABLE, 'r', '-')); + print!("{}", alt(Mode::WORLD_WRITABLE, 'w', '-')); if !mode.contains(Mode::STICKY) { - print!("{}", alt(Mode::USER_EXECUTABLE, 'x', '-')); + print!("{}", alt(Mode::WORLD_EXECUTABLE, 'x', '-')); } else { - print!("{}", alt(Mode::USER_EXECUTABLE, 't', 'T')); + print!("{}", alt(Mode::WORLD_EXECUTABLE, 't', 'T')); } } diff --git a/src/repl/reader.rs b/src/repl/reader.rs index b1d40a9..79ee0d1 100644 --- a/src/repl/reader.rs +++ b/src/repl/reader.rs @@ -251,10 +251,10 @@ pub fn read( break; } } - if !tokens.is_empty() { - if let Token::Value(Value::Str(cmd)) = tokens[0].clone() { - tokens[0] = Token::Value(Value::Cmd(cmd)); - } + if !tokens.is_empty() + && let Token::Value(Value::Str(cmd)) = tokens[0].clone() + { + tokens[0] = Token::Value(Value::Cmd(cmd)); } cmds.push(Command::Cmd(cmdline, tokens)); } diff --git a/xtask/Cargo.toml b/xtask/Cargo.toml index 3af48f7..aa66bab 100644 --- a/xtask/Cargo.toml +++ b/xtask/Cargo.toml @@ -7,4 +7,4 @@ edition = "2021" [dependencies] clap = { version = "4.4", features = ["derive"] } -duct = "0.13" +duct = "1.0"