diff --git a/Cargo.toml b/Cargo.toml index e5e4f58..4ced634 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,3 +16,7 @@ exclude = ["/.gitlab-ci.yml", ".gitignore", ".gitattributes", "/.github/*"] [dependencies] aarch64-cpu = { version = "9.3" } tock-registers = { version = "0.8.x", default-features = false } + +[features] +default = ["nightly"] +nightly = [] diff --git a/src/instructions.rs b/src/instructions.rs index 8628345..03631bd 100644 --- a/src/instructions.rs +++ b/src/instructions.rs @@ -6,7 +6,9 @@ pub fn halt() { unsafe { asm!("wfi", options(nomem, nostack)) } } -mod exceptions { +#[cfg(feature = "nightly")] +#[allow(clippy::missing_safety_doc)] +pub mod exceptions { use core::arch::asm; /// Generate an exception targeting EL1, with the specified exception code diff --git a/src/lib.rs b/src/lib.rs index fe781d6..98f9bde 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -6,8 +6,7 @@ // copied, modified, or distributed except according to those terms. #![allow(dead_code)] -#![allow(stable_features)] -#![feature(asm_const, core_intrinsics)] +#![cfg_attr(feature = "nightly", feature(asm_const))] #![no_std] pub mod instructions; diff --git a/src/paging.rs b/src/paging.rs index 609a9fe..c552ef4 100644 --- a/src/paging.rs +++ b/src/paging.rs @@ -1,4 +1,3 @@ -use core::convert::{From, Into}; use core::fmt; use core::ops;