Skip to content

Commit 286b0b5

Browse files
author
Dan Cross
committed
trivial: clean up lints
Standardize on a single common `panic!` implementation and add some compilation directives to clean up lints. Signed-off-by: Dan Cross <[email protected]>
1 parent 5aced95 commit 286b0b5

File tree

5 files changed

+6
-19
lines changed

5 files changed

+6
-19
lines changed

hypatia/src/runtime.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,13 @@
99
#[macro_export]
1010
macro_rules! runtime {
1111
() => {
12-
#[cfg(not(test))]
12+
#[cfg(all(target_os="none"))]
1313
mod no_std_runtime {
1414
use core::panic::PanicInfo;
1515

1616
#[panic_handler]
17-
pub extern "C" fn panic(_info: &PanicInfo) -> ! {
17+
pub extern "C" fn panic(info: &PanicInfo) -> ! {
18+
hypatia::panic::print_panic(info);
1819
#[allow(clippy::empty_loop)]
1920
loop {}
2021
}

theon/src/main.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,5 +309,4 @@ pub extern "C" fn apmain(cpu: arch::ProcessorID) -> ! {
309309
panic!("apmain");
310310
}
311311

312-
#[cfg(not(test))]
313-
mod runtime;
312+
hypatia::runtime!();

theon/src/runtime.rs

Lines changed: 0 additions & 15 deletions
This file was deleted.

x86_64/src/gdt.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ impl GDT {
109109
/// # Safety
110110
///
111111
/// Must be called on a valid, initialized GDT.
112+
#[allow(clippy::needless_pass_by_ref_mut)]
112113
pub unsafe fn load(gdt: &'static mut GDT) {
113114
unsafe {
114115
gdt.lgdt();

x86_64/src/tss.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ impl TSS {
8686
}
8787
}
8888

89+
#[allow(clippy::needless_pass_by_ref_mut)]
8990
pub fn set_stack(&mut self, index: StackIndex, stack: &mut HyperStack) {
9091
let va = stack.top().addr() as u64;
9192
let lower = va.get_bits(0..32) as u32;

0 commit comments

Comments
 (0)