fix: utils: add missing warn.rs

This commit is contained in:
Paul Pan 2024-05-04 23:31:04 +08:00
parent 2bb9e9b651
commit 750a48f281

15
lib/utils/src/warn.rs Normal file
View 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;
}
}
};
}