Rollup merge of #122827 - compiler-errors:span-bugs, r=WaffleLapkin
Remove unnecessary braces from `bug`/`span_bug` They make never fallback weird and are unnecessary r? `@WaffleLapkin`
This commit is contained in:
commit
6ae51a5fed
1 changed files with 19 additions and 9 deletions
|
@ -11,12 +11,18 @@
|
||||||
/// [`span_bug`]: crate::span_bug
|
/// [`span_bug`]: crate::span_bug
|
||||||
#[macro_export]
|
#[macro_export]
|
||||||
macro_rules! bug {
|
macro_rules! bug {
|
||||||
() => ( $crate::bug!("impossible case reached") );
|
() => (
|
||||||
($msg:expr) => ({ $crate::util::bug::bug_fmt(::std::format_args!($msg)) });
|
$crate::bug!("impossible case reached")
|
||||||
($msg:expr,) => ({ $crate::bug!($msg) });
|
);
|
||||||
($fmt:expr, $($arg:tt)+) => ({
|
($msg:expr) => (
|
||||||
|
$crate::util::bug::bug_fmt(::std::format_args!($msg))
|
||||||
|
);
|
||||||
|
($msg:expr,) => (
|
||||||
|
$crate::bug!($msg)
|
||||||
|
);
|
||||||
|
($fmt:expr, $($arg:tt)+) => (
|
||||||
$crate::util::bug::bug_fmt(::std::format_args!($fmt, $($arg)+))
|
$crate::util::bug::bug_fmt(::std::format_args!($fmt, $($arg)+))
|
||||||
});
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A macro for triggering an ICE with a span.
|
/// A macro for triggering an ICE with a span.
|
||||||
|
@ -30,11 +36,15 @@ macro_rules! bug {
|
||||||
/// [`DiagCtxt::span_delayed_bug`]: rustc_errors::DiagCtxt::span_delayed_bug
|
/// [`DiagCtxt::span_delayed_bug`]: rustc_errors::DiagCtxt::span_delayed_bug
|
||||||
#[macro_export]
|
#[macro_export]
|
||||||
macro_rules! span_bug {
|
macro_rules! span_bug {
|
||||||
($span:expr, $msg:expr) => ({ $crate::util::bug::span_bug_fmt($span, ::std::format_args!($msg)) });
|
($span:expr, $msg:expr) => (
|
||||||
($span:expr, $msg:expr,) => ({ $crate::span_bug!($span, $msg) });
|
$crate::util::bug::span_bug_fmt($span, ::std::format_args!($msg))
|
||||||
($span:expr, $fmt:expr, $($arg:tt)+) => ({
|
);
|
||||||
|
($span:expr, $msg:expr,) => (
|
||||||
|
$crate::span_bug!($span, $msg)
|
||||||
|
);
|
||||||
|
($span:expr, $fmt:expr, $($arg:tt)+) => (
|
||||||
$crate::util::bug::span_bug_fmt($span, ::std::format_args!($fmt, $($arg)+))
|
$crate::util::bug::span_bug_fmt($span, ::std::format_args!($fmt, $($arg)+))
|
||||||
});
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue