mirror of
https://github.com/panpaul/tiny_os
synced 2024-09-20 09:45:19 +08:00
fix: utils: add missing warn.rs
This commit is contained in:
parent
2bb9e9b651
commit
750a48f281
15
lib/utils/src/warn.rs
Normal file
15
lib/utils/src/warn.rs
Normal file
@ -0,0 +1,15 @@
|
||||
// Taken from https://internals.rust-lang.org/t/pre-rfc-add-compile-warning-macro/9370/7
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! compile_warning {
|
||||
($name:ident, $message:expr $(,)*) => {
|
||||
mod $name {
|
||||
#[must_use = $message]
|
||||
struct compile_warning;
|
||||
#[allow(dead_code)]
|
||||
fn trigger_warning() {
|
||||
compile_warning;
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue
Block a user