In a Rust program, it is possible to emit a compiler error and halt the translation machinery, for example:
macro_rules! a {
($name:ident) => {println!("{}", name)};
($exp:expr) => {compile_error!("Do not use an expression.")};
}
Is there a similar macro to emit a compile-time warning? I'm using the syn
crate and have through the documentation, but couldn't find any reference.
The only thing I can find in the documentation are a series of nightly-only APIs, which won't work for my use case because I can't use a nightly release.