docs.rs failed to build compile_msg-0.1.3
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
compile_msg
A syntax extension for emitting messages at compile time, via the
compiler, similar to #warning
and #error
in the C
preprocessor. Four macros are provided (in order of increasing
severity):
compile_note
: tell the user a tidbit of information without implying it is a problem,compile_warning
: tell the user that something could go wrong,compile_error
: tell the user about some error, compilation will not stop immediately, but will halt before any compiler passes after macro expansion.compile_fatal
: tell the user about a catastrophic error and immediately halt compilation.compile_error
is strongly preferred as it allows further errors and warnings to be picked up in a single pass.
The macros can be placed as an item (expanding to nothing), and as an
expression (expanding to a literal unit, i.e. ()
). They are best
used in conditionally compiled items, e.g. if a certain operating
system is entirely unsupported, one can use compile_error!
with an
appropriate #[cfg]
attribute.
Usage
Ensure your Cargo.toml
contains
[]
= "https://github.com/huonw/compile_msg"
and then load the syntax in the normal manner:
extern crate compile_msg;
compile_error!;
(If that compiled, it would be equivalent to fn main() {}
at runtime.)