($span:expr, $level:expr, $msg:expr ; $($rest:tt)+) => {{ #[allow(unused_imports)] use $crate::__export::{
ToTokensAsSpanRange,
Span2AsSpanRange,
SpanAsSpanRange,
SpanRangeAsSpanRange
}; use $crate::DiagnosticExt; let span_range = (&$span).FIRST_ARG_MUST_EITHER_BE_Span_OR_IMPLEMENT_ToTokens_OR_BE_SpanRange();
let diag = $crate::Diagnostic::spanned_range(span_range, $level, $msg.to_string());
$crate::__pme__suggestions!(diag $($rest)*);
diag
}};
// span, message, no help
($span:expr, $level:expr, $fmt:expr, $($args:expr),+) => {{ #[allow(unused_imports)] use $crate::__export::{
ToTokensAsSpanRange,
Span2AsSpanRange,
SpanAsSpanRange,
SpanRangeAsSpanRange
}; use $crate::DiagnosticExt; let span_range = (&$span).FIRST_ARG_MUST_EITHER_BE_Span_OR_IMPLEMENT_ToTokens_OR_BE_SpanRange();
/// Shortcut for `abort!(Span::call_site(), msg...)`. This macro /// is still preferable over plain panic, panics are not for error reporting. /// /// # Syntax /// /// See [the guide](index.html#guide). /// #[macro_export]
macro_rules! abort_call_site {
($($tts:tt)*) => {
$crate::abort!($crate::__export::proc_macro2::Span::call_site(), $($tts)*)
};
}
/// Emit an error while not aborting the proc-macro right away. /// /// # Syntax /// /// See [the guide](index.html#guide). /// #[macro_export]
macro_rules! emit_error {
($err:expr) => {
$crate::diagnostic!($err).emit()
};
/// Shortcut for `emit_error!(Span::call_site(), ...)`. This macro /// is still preferable over plain panic, panics are not for error reporting.. /// /// # Syntax /// /// See [the guide](index.html#guide). /// #[macro_export]
macro_rules! emit_call_site_error {
($($tts:tt)*) => {
$crate::emit_error!($crate::__export::proc_macro2::Span::call_site(), $($tts)*)
};
}
/// Emit a warning. Warnings are not errors and compilation won't fail because of them. /// /// **Does nothing on stable** /// /// # Syntax /// /// See [the guide](index.html#guide). /// #[macro_export]
macro_rules! emit_warning {
($span:expr, $($tts:tt)*) => {
$crate::diagnostic!($span, $crate::Level::Warning, $($tts)*).emit()
};
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.