Skip to content

Commit

Permalink
cargo fmt and use core::compile_error
Browse files Browse the repository at this point in the history
  • Loading branch information
64 committed Aug 5, 2019
1 parent 2fdd1f2 commit 83729b9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
13 changes: 7 additions & 6 deletions 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")]
Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Expand Up @@ -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.
Expand Down

0 comments on commit 83729b9

Please sign in to comment.