Skip to content

Commit 83729b9

Browse files
committed
cargo fmt and use core::compile_error
1 parent 2fdd1f2 commit 83729b9

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

build.rs

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
#[cfg(not(feature = "binary"))]
2-
#[allow(unreachable_code)]
32
fn main() {
4-
#[cfg(target_arch = "x86")]
5-
panic!("This crate currently does not support 32-bit protected mode. \
6-
See https://github.com/rust-osdev/bootloader/issues/70 for more information.");
3+
//#[cfg(target_arch = "x86")]
4+
compile_error!(
5+
"This crate currently does not support 32-bit protected mode. \
6+
See https://github.com/rust-osdev/bootloader/issues/70 for more information."
7+
);
78

8-
#[cfg(not(target_arch = "x86_64"))]
9-
panic!("This crate only supports the x86_64 architecture.");
9+
#[cfg(not(any(target_arch = "x86_64", target_arch = "x86")))]
10+
compile_error!("This crate only supports the x86_64 architecture.");
1011
}
1112

1213
#[cfg(feature = "binary")]

src/main.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ use x86_64::ux::u9;
2525
use x86_64::{PhysAddr, VirtAddr};
2626

2727
// The bootloader_config.rs file contains some configuration constants set by the build script:
28-
// PHYSICAL_MEMORY_OFFSET: The offset into the virtual address space where the physical memory
28+
// PHYSICAL_MEMORY_OFFSET: The offset into the virtual address space where the physical memory
2929
// is mapped if the `map_physical_memory` feature is activated.
3030
//
3131
// KERNEL_STACK_ADDRESS: The virtual address of the kernel stack.

0 commit comments

Comments
 (0)