Skip to content

Commit

Permalink
Merge pull request thesofproject#36 from Rust-for-Linux/rust-assert-cfg
Browse files Browse the repository at this point in the history
Ensure we don't break conditional compilation
  • Loading branch information
ojeda authored Nov 28, 2020
2 parents 9dfb40b + d0a8472 commit 1185f89
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions rust/kernel/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
#![no_std]
#![feature(allocator_api, alloc_error_handler)]

// Ensure conditional compilation based on the kernel configuration works;
// otherwise we may silently break things like initcall handling.
#[cfg(not(CONFIG_HAS_RUST))]
compile_error!("Missing kernel configuration for conditional compilation");

extern crate alloc;

use core::panic::PanicInfo;
Expand Down

0 comments on commit 1185f89

Please sign in to comment.