From 673589377320522295431f0a095cd81b4e1dc53e Mon Sep 17 00:00:00 2001 From: James Munns Date: Thu, 10 Aug 2023 11:53:54 -0500 Subject: [PATCH 01/10] Fix clippy warnings and enforce -Dwarnings --- justfile | 8 +++++--- platforms/allwinner-d1/core/src/clint.rs | 6 ++++++ platforms/allwinner-d1/core/src/drivers/spim.rs | 5 ++++- platforms/allwinner-d1/core/src/drivers/twi.rs | 3 +++ platforms/allwinner-d1/core/src/drivers/uart.rs | 3 +++ platforms/beepy/src/i2c_puppet.rs | 2 +- platforms/melpomene/src/sim_drivers/tcp_serial.rs | 8 ++++---- 7 files changed, 26 insertions(+), 9 deletions(-) diff --git a/justfile b/justfile index 4a59c5b4..233bdbd7 100644 --- a/justfile +++ b/justfile @@ -60,14 +60,16 @@ check-crate crate: clippy: && (clippy-crate _d1_pkg) (clippy-crate _espbuddy_pkg) (clippy-crate _x86_bootloader_pkg) {{ _cargo }} clippy \ --lib --bins --examples --tests --benches --all-features \ - {{ _fmt }} + {{ _fmt }} \ + -- -Dwarnings # run clippy checks for a crate. clippy-crate crate: {{ _cargo }} clippy \ --lib --bins --examples --tests --benches \ --package {{ crate }} \ - {{ _fmt }} + {{ _fmt }} \ + -- -Dwarnings # test all packages, across workspaces test: (_get-cargo-command "nextest" "cargo-nextest" no-nextest) @@ -158,4 +160,4 @@ _get-cargo-command name pkg skip='': err "missing cargo-{{ name }} executable" if confirm " install it?"; then cargo install {{ pkg }} - fi \ No newline at end of file + fi diff --git a/platforms/allwinner-d1/core/src/clint.rs b/platforms/allwinner-d1/core/src/clint.rs index 1c042da1..e267223c 100644 --- a/platforms/allwinner-d1/core/src/clint.rs +++ b/platforms/allwinner-d1/core/src/clint.rs @@ -21,6 +21,12 @@ impl Clint { self.clint } + /// Summon the clint peripheral + /// + /// # Safety + /// + /// This is intended for use in interrupt context. Care should be taken not to have + /// multiple instances live at the same time that may race or cause other UB issues #[must_use] pub unsafe fn summon() -> Self { Self { diff --git a/platforms/allwinner-d1/core/src/drivers/spim.rs b/platforms/allwinner-d1/core/src/drivers/spim.rs index 7e691c64..f7046cbb 100644 --- a/platforms/allwinner-d1/core/src/drivers/spim.rs +++ b/platforms/allwinner-d1/core/src/drivers/spim.rs @@ -1,4 +1,7 @@ -// Spi Sender +// Note: We sometimes force a pass by ref mut to enforce exclusive access +#![allow(clippy::needless_pass_by_ref_mut)] + +//! Spi Sender use core::ptr::NonNull; diff --git a/platforms/allwinner-d1/core/src/drivers/twi.rs b/platforms/allwinner-d1/core/src/drivers/twi.rs index fa9a8325..04f39340 100644 --- a/platforms/allwinner-d1/core/src/drivers/twi.rs +++ b/platforms/allwinner-d1/core/src/drivers/twi.rs @@ -1,3 +1,6 @@ +// Note: We sometimes force a pass by ref mut to enforce exclusive access +#![allow(clippy::needless_pass_by_ref_mut)] + //! Drivers for the Allwinner D1's I²C/TWI peripherals. //! //! This module contains an implementation of a driver for controlling the diff --git a/platforms/allwinner-d1/core/src/drivers/uart.rs b/platforms/allwinner-d1/core/src/drivers/uart.rs index 7acacbc9..fdff961b 100644 --- a/platforms/allwinner-d1/core/src/drivers/uart.rs +++ b/platforms/allwinner-d1/core/src/drivers/uart.rs @@ -1,3 +1,6 @@ +// Note: We sometimes force a pass by ref mut to enforce exclusive access +#![allow(clippy::needless_pass_by_ref_mut)] + use d1_pac::{GPIO, UART0}; use core::{ diff --git a/platforms/beepy/src/i2c_puppet.rs b/platforms/beepy/src/i2c_puppet.rs index 34e544a4..5550422f 100644 --- a/platforms/beepy/src/i2c_puppet.rs +++ b/platforms/beepy/src/i2c_puppet.rs @@ -241,7 +241,7 @@ pub enum RegistrationError { // https://github.com/solderparty/i2c_puppet#protocol const ADDR: u8 = 0x1f; -//// i2c_puppet I2C registers +/// i2c_puppet I2C registers mod reg { /// To write with a register, we must OR the register number with this mask: /// diff --git a/platforms/melpomene/src/sim_drivers/tcp_serial.rs b/platforms/melpomene/src/sim_drivers/tcp_serial.rs index 4e6bb777..560caa28 100644 --- a/platforms/melpomene/src/sim_drivers/tcp_serial.rs +++ b/platforms/melpomene/src/sim_drivers/tcp_serial.rs @@ -64,11 +64,11 @@ impl TcpSerial { let _hdl = tokio::spawn( async move { - let mut handle = a_ring; + let handle = a_ring; loop { match listener.accept().await { Ok((stream, addr)) => { - process_stream(&mut handle, stream, irq.clone()) + process_stream(&handle, stream, irq.clone()) .instrument(info_span!("process_stream", client.addr = %addr)) .await } @@ -88,7 +88,7 @@ impl TcpSerial { } } -async fn process_stream(handle: &mut BidiHandle, mut stream: TcpStream, irq: Arc) { +async fn process_stream(handle: &BidiHandle, mut stream: TcpStream, irq: Arc) { loop { // Wait until either the socket has data to read, or the other end of // the BBQueue has data to write. @@ -111,7 +111,7 @@ async fn process_stream(handle: &mut BidiHandle, mut stream: TcpStream, irq: Arc // Try to read data, this may still fail with `WouldBlock` // if the readiness event is a false positive. match stream.try_read(&mut in_grant) { - Ok(used) if used == 0 => { + Ok(0) => { warn!("Empty read, socket probably closed."); return; }, From 8eebf7423174c93a530336e6818c7bc0fc80bf35 Mon Sep 17 00:00:00 2001 From: James Munns Date: Thu, 10 Aug 2023 12:01:22 -0500 Subject: [PATCH 02/10] Retool justfile --- justfile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/justfile b/justfile index 233bdbd7..66034fe4 100644 --- a/justfile +++ b/justfile @@ -15,10 +15,10 @@ _rustflags := env_var_or_default("RUSTFLAGS", "") # If we're running in Github Actions and cargo-action-fmt is installed, then add # a command suffix that formats errors. -_fmt := if env_var_or_default("GITHUB_ACTIONS", "") != "true" { "" } else { +_fmt := if env_var_or_default("GITHUB_ACTIONS", "") != "true" { "-- -Dwarnings" } else { ``` if command -v cargo-action-fmt >/dev/null 2>&1; then - echo "--message-format=json | cargo-action-fmt" + echo "--message-format=json -- -Dwarnings | cargo-action-fmt" fi ``` } @@ -57,19 +57,19 @@ check-crate crate: {{ _fmt }} # run Clippy checks for all crates, across workspaces. +# NOTE: -Dwarnings is added by _fmt because reasons clippy: && (clippy-crate _d1_pkg) (clippy-crate _espbuddy_pkg) (clippy-crate _x86_bootloader_pkg) {{ _cargo }} clippy \ --lib --bins --examples --tests --benches --all-features \ - {{ _fmt }} \ - -- -Dwarnings + {{ _fmt }} # run clippy checks for a crate. +# NOTE: -Dwarnings is added by _fmt because reasons clippy-crate crate: {{ _cargo }} clippy \ --lib --bins --examples --tests --benches \ --package {{ crate }} \ - {{ _fmt }} \ - -- -Dwarnings + {{ _fmt }} # test all packages, across workspaces test: (_get-cargo-command "nextest" "cargo-nextest" no-nextest) From 1660b5bbcc83ffd0ef334a044597f204ca638ef9 Mon Sep 17 00:00:00 2001 From: James Munns Date: Thu, 10 Aug 2023 12:08:20 -0500 Subject: [PATCH 03/10] Fix some more clippy lints --- platforms/x86_64/core/src/interrupt.rs | 1 + platforms/x86_64/core/src/trace.rs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/platforms/x86_64/core/src/interrupt.rs b/platforms/x86_64/core/src/interrupt.rs index b3af7e1c..b2be9e4c 100644 --- a/platforms/x86_64/core/src/interrupt.rs +++ b/platforms/x86_64/core/src/interrupt.rs @@ -111,6 +111,7 @@ impl hal_core::interrupt::Handlers for InterruptHandlers { C: interrupt::Context + interrupt::ctx::CodeFault, { // TODO: add a nice fault handler + #[allow(clippy::let_unit_value)] let _fault = match cx.details() { Some(deets) => panic!("code fault {}: \n{deets}", cx.fault_kind()), None => panic!("code fault {}!", cx.fault_kind()), diff --git a/platforms/x86_64/core/src/trace.rs b/platforms/x86_64/core/src/trace.rs index 7aa00970..832fea0d 100644 --- a/platforms/x86_64/core/src/trace.rs +++ b/platforms/x86_64/core/src/trace.rs @@ -127,7 +127,7 @@ where } }) as &mut dyn tracing::field::Visit, ); - writeln!(&mut writer, "").unwrap(); + writeln!(&mut writer).unwrap(); self.point .store(pack_point(writer.next_point()), Ordering::Release); From bb300f768488f4699dd938870915e8b4f3c2caef Mon Sep 17 00:00:00 2001 From: James Munns Date: Thu, 10 Aug 2023 12:10:42 -0500 Subject: [PATCH 04/10] Whoops didn't commit this one --- platforms/x86_64/core/src/drivers/framebuf.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platforms/x86_64/core/src/drivers/framebuf.rs b/platforms/x86_64/core/src/drivers/framebuf.rs index 5abebc7b..bb513060 100644 --- a/platforms/x86_64/core/src/drivers/framebuf.rs +++ b/platforms/x86_64/core/src/drivers/framebuf.rs @@ -73,7 +73,7 @@ where // if we have reached the bottom of the screen, we'll need to scroll // previous framebuffer contents up to make room for new line(s) of // text. - self.point.y = self.point.y + self.style.font.character_size.height as i32; + self.point.y += self.style.font.character_size.height as i32; self.point.x = self.start_x; } } @@ -133,7 +133,7 @@ where // line, wrap the line. let rem = self.px_to_len(self.width_px - (self.point.x as u32)); if line.len() > rem { - let (curr, next) = line.split_at(rem as usize); + let (curr, next) = line.split_at(rem); line = next; chunk = curr; has_newline = true; From 9cd2aa626bf07d33b0dcaadf8807cd89070fc9c2 Mon Sep 17 00:00:00 2001 From: James Munns Date: Thu, 10 Aug 2023 12:16:32 -0500 Subject: [PATCH 05/10] More more more --- platforms/x86_64/core/src/bin/bootloader/framebuf.rs | 1 + platforms/x86_64/core/src/bin/bootloader/main.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/platforms/x86_64/core/src/bin/bootloader/framebuf.rs b/platforms/x86_64/core/src/bin/bootloader/framebuf.rs index 97324d49..066dc0d2 100644 --- a/platforms/x86_64/core/src/bin/bootloader/framebuf.rs +++ b/platforms/x86_64/core/src/bin/bootloader/framebuf.rs @@ -35,6 +35,7 @@ pub(super) unsafe fn mk_framebuf() -> FramebufWriter { /// This forcibly unlocks a potentially-locked mutex, violating mutual /// exclusion! This should only be called in conditions where no other CPU core /// will *ever* attempt to access the framebuffer again (such as while oopsing). +#[allow(dead_code)] pub(super) unsafe fn force_unlock() { if let Some((_, fb)) = FRAMEBUFFER.try_get() { fb.force_unlock(); diff --git a/platforms/x86_64/core/src/bin/bootloader/main.rs b/platforms/x86_64/core/src/bin/bootloader/main.rs index 28b28cc1..da924758 100644 --- a/platforms/x86_64/core/src/bin/bootloader/main.rs +++ b/platforms/x86_64/core/src/bin/bootloader/main.rs @@ -64,6 +64,7 @@ pub fn kernel_start(info: &'static mut bootloader_api::BootInfo) -> ! { #[cold] #[cfg_attr(target_os = "none", panic_handler)] +#[allow(dead_code)] fn panic(panic: &core::panic::PanicInfo<'_>) -> ! { use core::fmt::Write; use embedded_graphics::{ From 95771b0c56acd9fd55f3a405647343ff6429c8c0 Mon Sep 17 00:00:00 2001 From: James Munns Date: Thu, 10 Aug 2023 12:25:49 -0500 Subject: [PATCH 06/10] Change justfile again, I was breaking `just check` --- justfile | 22 ++++++++++++++++------ platforms/allwinner-d1/boards/build.rs | 2 +- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/justfile b/justfile index 66034fe4..f4533c63 100644 --- a/justfile +++ b/justfile @@ -15,7 +15,9 @@ _rustflags := env_var_or_default("RUSTFLAGS", "") # If we're running in Github Actions and cargo-action-fmt is installed, then add # a command suffix that formats errors. -_fmt := if env_var_or_default("GITHUB_ACTIONS", "") != "true" { "-- -Dwarnings" } else { +# +# Clippy version also gets -Dwarnings. +_fmt_clippy := if env_var_or_default("GITHUB_ACTIONS", "") != "true" { "-- -Dwarnings" } else { ``` if command -v cargo-action-fmt >/dev/null 2>&1; then echo "--message-format=json -- -Dwarnings | cargo-action-fmt" @@ -23,6 +25,14 @@ _fmt := if env_var_or_default("GITHUB_ACTIONS", "") != "true" { "-- -Dwarnings" ``` } +_fmt_check_doc := if env_var_or_default("GITHUB_ACTIONS", "") != "true" { "" } else { + ``` + if command -v cargo-action-fmt >/dev/null 2>&1; then + echo "--message-format=json | cargo-action-fmt" + fi + ``` +} + _d1_start_addr := "0x40000000" _d1_bin_path := "target/riscv64imac-unknown-none-elf" _d1_pkg := "mnemos-d1" @@ -47,21 +57,21 @@ default: check: && (check-crate _d1_pkg) (check-crate _espbuddy_pkg) (check-crate _x86_bootloader_pkg) {{ _cargo }} check \ --lib --bins --examples --tests --benches \ - {{ _fmt }} + {{ _fmt_check_doc }} # check a crate. check-crate crate: {{ _cargo }} check \ --lib --bins --examples --tests --benches --all-features \ --package {{ crate }} \ - {{ _fmt }} + {{ _fmt_check_doc }} # run Clippy checks for all crates, across workspaces. # NOTE: -Dwarnings is added by _fmt because reasons clippy: && (clippy-crate _d1_pkg) (clippy-crate _espbuddy_pkg) (clippy-crate _x86_bootloader_pkg) {{ _cargo }} clippy \ --lib --bins --examples --tests --benches --all-features \ - {{ _fmt }} + {{ _fmt_clippy }} # run clippy checks for a crate. # NOTE: -Dwarnings is added by _fmt because reasons @@ -69,7 +79,7 @@ clippy-crate crate: {{ _cargo }} clippy \ --lib --bins --examples --tests --benches \ --package {{ crate }} \ - {{ _fmt }} + {{ _fmt_clippy }} # test all packages, across workspaces test: (_get-cargo-command "nextest" "cargo-nextest" no-nextest) @@ -140,7 +150,7 @@ docs *FLAGS: {{ _cargo }} doc \ --all-features \ {{ FLAGS }} \ - {{ _fmt }} + {{ _fmt_check_doc }} _get-cargo-command name pkg skip='': #!/usr/bin/env bash diff --git a/platforms/allwinner-d1/boards/build.rs b/platforms/allwinner-d1/boards/build.rs index e4699083..c4ba999b 100644 --- a/platforms/allwinner-d1/boards/build.rs +++ b/platforms/allwinner-d1/boards/build.rs @@ -6,7 +6,7 @@ use std::path::Path; fn main() { let out_dir = env::var("OUT_DIR").expect("No out dir"); let dest_path = Path::new(&out_dir); - let mut f = File::create(&dest_path.join("memory.x")).expect("Could not create file"); + let mut f = File::create(dest_path.join("memory.x")).expect("Could not create file"); f.write_all(include_bytes!("memory.x")) .expect("Could not write file"); From de9855548ea1441a2c27415807b77b2af8a1a79f Mon Sep 17 00:00:00 2001 From: James Munns Date: Thu, 10 Aug 2023 12:32:44 -0500 Subject: [PATCH 07/10] More --- platforms/allwinner-d1/boards/src/bin/mq-pro.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/platforms/allwinner-d1/boards/src/bin/mq-pro.rs b/platforms/allwinner-d1/boards/src/bin/mq-pro.rs index 1d9d1e09..b6ff8eb0 100644 --- a/platforms/allwinner-d1/boards/src/bin/mq-pro.rs +++ b/platforms/allwinner-d1/boards/src/bin/mq-pro.rs @@ -128,6 +128,8 @@ fn main() -> ! { d1.run() } +// Note: pass by ref mut to enforce exclusive access +#[allow(clippy::needless_pass_by_ref_mut)] fn init_i2c_puppet_irq(gpio: &mut d1_pac::GPIO, plic: &mut Plic) -> &'static WaitCell { use d1_pac::Interrupt; use mnemos_d1_core::plic::Priority; From 4e5180a1115b755164b202553e2e02abdcade5d7 Mon Sep 17 00:00:00 2001 From: James Munns Date: Thu, 10 Aug 2023 12:39:08 -0500 Subject: [PATCH 08/10] Just one more I swear just one more is all I need --- platforms/esp32c3-buddy/src/heap.rs | 3 +++ platforms/esp32c3-buddy/src/lib.rs | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/platforms/esp32c3-buddy/src/heap.rs b/platforms/esp32c3-buddy/src/heap.rs index 9ce61bb8..0b70aa59 100644 --- a/platforms/esp32c3-buddy/src/heap.rs +++ b/platforms/esp32c3-buddy/src/heap.rs @@ -38,6 +38,9 @@ impl UnderlyingAllocator for UnderlyingEspHeap { /// /// May or may not require a call to [UnderlyingAllocator::init()] before the allocator /// is actually ready for use. + // + // TODO: Clippy has a point here as this is misuse prone, but silence for now. + #[allow(clippy::declare_interior_mutable_const)] const INIT: Self = UnderlyingEspHeap(EspHeap::empty()); /// Initialize the allocator, if it is necessary to populate with a region diff --git a/platforms/esp32c3-buddy/src/lib.rs b/platforms/esp32c3-buddy/src/lib.rs index 59a5a8dd..3ce0c6ea 100644 --- a/platforms/esp32c3-buddy/src/lib.rs +++ b/platforms/esp32c3-buddy/src/lib.rs @@ -101,7 +101,7 @@ pub fn run(k: &'static Kernel, alarm1: Alarm) -> ! { // Timer is downcounting let elapsed = SystemTimer::now() - start; - let turn = k.timer().force_advance_ticks(elapsed as u64 / 2u64); + let turn = k.timer().force_advance_ticks(elapsed / 2u64); // If there is nothing else scheduled, and we didn't just wake something up, // sleep for some amount of time @@ -138,7 +138,7 @@ pub fn run(k: &'static Kernel, alarm1: Alarm) -> ! { // Account for time slept let elapsed = SystemTimer::now() - wfi_start; - let _turn = k.timer().force_advance_ticks(elapsed as u64 / 2u64); + let _turn = k.timer().force_advance_ticks(elapsed / 2u64); } } } From 46e2f67f2c8f3c3c902dbb95f328eba4e740b6cb Mon Sep 17 00:00:00 2001 From: James Munns Date: Thu, 10 Aug 2023 12:44:46 -0500 Subject: [PATCH 09/10] please --- platforms/esp32c3-buddy/src/bin/qtpy.rs | 4 ++-- platforms/esp32c3-buddy/src/bin/xiao.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/platforms/esp32c3-buddy/src/bin/qtpy.rs b/platforms/esp32c3-buddy/src/bin/qtpy.rs index 89696dcc..dfbe4364 100644 --- a/platforms/esp32c3-buddy/src/bin/qtpy.rs +++ b/platforms/esp32c3-buddy/src/bin/qtpy.rs @@ -40,7 +40,7 @@ fn main() -> ! { let k = mnemos_esp32c3_buddy::init(); mnemos_esp32c3_buddy::spawn_serial( - &k, + k, peripherals.USB_DEVICE, &mut system.peripheral_clock_control, ); @@ -51,5 +51,5 @@ fn main() -> ! { // Alarm 1 will be used to generate "sleep until" interrupts. let alarm1 = syst.alarm1; - mnemos_esp32c3_buddy::run(&k, alarm1) + mnemos_esp32c3_buddy::run(k, alarm1) } diff --git a/platforms/esp32c3-buddy/src/bin/xiao.rs b/platforms/esp32c3-buddy/src/bin/xiao.rs index 8dce87f8..cf5c006e 100644 --- a/platforms/esp32c3-buddy/src/bin/xiao.rs +++ b/platforms/esp32c3-buddy/src/bin/xiao.rs @@ -41,7 +41,7 @@ fn main() -> ! { mnemos_esp32c3_buddy::spawn_daemons(k); mnemos_esp32c3_buddy::spawn_serial( - &k, + k, peripherals.USB_DEVICE, &mut system.peripheral_clock_control, ); @@ -51,5 +51,5 @@ fn main() -> ! { // Alarm 1 will be used to generate "sleep until" interrupts. let alarm1 = syst.alarm1; - mnemos_esp32c3_buddy::run(&k, alarm1) + mnemos_esp32c3_buddy::run(k, alarm1) } From 76ad4d218a9497da101cf94671e1875928306e16 Mon Sep 17 00:00:00 2001 From: James Munns Date: Fri, 11 Aug 2023 18:15:32 -0500 Subject: [PATCH 10/10] Address review nits --- justfile | 1 - platforms/esp32c3-buddy/src/heap.rs | 6 +++++- platforms/x86_64/core/src/interrupt.rs | 3 +-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/justfile b/justfile index f4533c63..72ae0712 100644 --- a/justfile +++ b/justfile @@ -67,7 +67,6 @@ check-crate crate: {{ _fmt_check_doc }} # run Clippy checks for all crates, across workspaces. -# NOTE: -Dwarnings is added by _fmt because reasons clippy: && (clippy-crate _d1_pkg) (clippy-crate _espbuddy_pkg) (clippy-crate _x86_bootloader_pkg) {{ _cargo }} clippy \ --lib --bins --examples --tests --benches --all-features \ diff --git a/platforms/esp32c3-buddy/src/heap.rs b/platforms/esp32c3-buddy/src/heap.rs index 0b70aa59..2596d6e5 100644 --- a/platforms/esp32c3-buddy/src/heap.rs +++ b/platforms/esp32c3-buddy/src/heap.rs @@ -39,7 +39,11 @@ impl UnderlyingAllocator for UnderlyingEspHeap { /// May or may not require a call to [UnderlyingAllocator::init()] before the allocator /// is actually ready for use. // - // TODO: Clippy has a point here as this is misuse prone, but silence for now. + // clippy note: + // + // > A “non-constant” const item is a legacy way to supply an initialized value to + // > downstream static items (e.g., the std::sync::ONCE_INIT constant). In this + // > case the use of const is legit, and this lint should be suppressed. #[allow(clippy::declare_interior_mutable_const)] const INIT: Self = UnderlyingEspHeap(EspHeap::empty()); diff --git a/platforms/x86_64/core/src/interrupt.rs b/platforms/x86_64/core/src/interrupt.rs index b2be9e4c..724f3979 100644 --- a/platforms/x86_64/core/src/interrupt.rs +++ b/platforms/x86_64/core/src/interrupt.rs @@ -111,8 +111,7 @@ impl hal_core::interrupt::Handlers for InterruptHandlers { C: interrupt::Context + interrupt::ctx::CodeFault, { // TODO: add a nice fault handler - #[allow(clippy::let_unit_value)] - let _fault = match cx.details() { + match cx.details() { Some(deets) => panic!("code fault {}: \n{deets}", cx.fault_kind()), None => panic!("code fault {}!", cx.fault_kind()), };