From 83729b90bc0dd9bdbbb23b18f52472b496318b42 Mon Sep 17 00:00:00 2001 From: Matt Taylor Date: Mon, 5 Aug 2019 16:25:10 +0100 Subject: [PATCH] cargo fmt and use core::compile_error --- build.rs | 13 +++++++------ src/main.rs | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/build.rs b/build.rs index c783fb16..478bcd72 100644 --- a/build.rs +++ b/build.rs @@ -1,12 +1,13 @@ #[cfg(not(feature = "binary"))] -#[allow(unreachable_code)] fn main() { - #[cfg(target_arch = "x86")] - panic!("This crate currently does not support 32-bit protected mode. \ - See https://github.com/rust-osdev/bootloader/issues/70 for more information."); + //#[cfg(target_arch = "x86")] + compile_error!( + "This crate currently does not support 32-bit protected mode. \ + See https://github.com/rust-osdev/bootloader/issues/70 for more information." + ); - #[cfg(not(target_arch = "x86_64"))] - panic!("This crate only supports the x86_64 architecture."); + #[cfg(not(any(target_arch = "x86_64", target_arch = "x86")))] + compile_error!("This crate only supports the x86_64 architecture."); } #[cfg(feature = "binary")] diff --git a/src/main.rs b/src/main.rs index 6f4a4492..e8294172 100644 --- a/src/main.rs +++ b/src/main.rs @@ -25,7 +25,7 @@ use x86_64::ux::u9; use x86_64::{PhysAddr, VirtAddr}; // The bootloader_config.rs file contains some configuration constants set by the build script: -// PHYSICAL_MEMORY_OFFSET: The offset into the virtual address space where the physical memory +// PHYSICAL_MEMORY_OFFSET: The offset into the virtual address space where the physical memory // is mapped if the `map_physical_memory` feature is activated. // // KERNEL_STACK_ADDRESS: The virtual address of the kernel stack.