44///
55/// If you have a span available, you should use [`span_bug`] instead.
66///
7- /// If the bug should only be emitted when compilation didn't fail, [`DiagCtxtHandle::span_delayed_bug`]
8- /// may be useful.
7+ /// If the bug should only be emitted when compilation didn't fail,
8+ /// [`DiagCtxtHandle::span_delayed_bug`] may be useful.
99///
1010/// [`DiagCtxtHandle::span_delayed_bug`]: rustc_errors::DiagCtxtHandle::span_delayed_bug
1111/// [`span_bug`]: crate::span_bug
@@ -14,14 +14,8 @@ macro_rules! bug {
1414 ( ) => (
1515 $crate:: bug!( "impossible case reached" )
1616 ) ;
17- ( $msg: expr) => (
18- $crate:: util:: bug:: bug_fmt( :: std:: format_args!( $msg) )
19- ) ;
20- ( $msg: expr, ) => (
21- $crate:: bug!( $msg)
22- ) ;
23- ( $fmt: expr, $( $arg: tt) +) => (
24- $crate:: util:: bug:: bug_fmt( :: std:: format_args!( $fmt, $( $arg) +) )
17+ ( $( $arg: tt) +) => (
18+ $crate:: util:: bug:: bug_fmt( :: std:: format_args!( $( $arg) +) )
2519 ) ;
2620}
2721
@@ -30,20 +24,14 @@ macro_rules! bug {
3024/// at the code the compiler was compiling when it ICEd. This is the preferred way to trigger
3125/// ICEs.
3226///
33- /// If the bug should only be emitted when compilation didn't fail, [`DiagCtxtHandle::span_delayed_bug`]
34- /// may be useful.
27+ /// If the bug should only be emitted when compilation didn't fail,
28+ /// [`DiagCtxtHandle::span_delayed_bug`] may be useful.
3529///
3630/// [`DiagCtxtHandle::span_delayed_bug`]: rustc_errors::DiagCtxtHandle::span_delayed_bug
3731#[ macro_export]
3832macro_rules! span_bug {
39- ( $span: expr, $msg: expr) => (
40- $crate:: util:: bug:: span_bug_fmt( $span, :: std:: format_args!( $msg) )
41- ) ;
42- ( $span: expr, $msg: expr, ) => (
43- $crate:: span_bug!( $span, $msg)
44- ) ;
45- ( $span: expr, $fmt: expr, $( $arg: tt) +) => (
46- $crate:: util:: bug:: span_bug_fmt( $span, :: std:: format_args!( $fmt, $( $arg) +) )
33+ ( $span: expr, $( $arg: tt) +) => (
34+ $crate:: util:: bug:: span_bug_fmt( $span, :: std:: format_args!( $( $arg) +) )
4735 ) ;
4836}
4937
@@ -53,7 +41,6 @@ macro_rules! span_bug {
5341// When possible, use one of these (relatively) convenient macros to write
5442// the impls for you.
5543
56- #[ macro_export]
5744macro_rules! TrivialLiftImpls {
5845 ( $( $ty: ty) ,+ $( , ) ?) => {
5946 $(
@@ -69,7 +56,6 @@ macro_rules! TrivialLiftImpls {
6956
7057/// Used for types that are `Copy` and which **do not care about arena
7158/// allocated data** (i.e., don't need to be folded).
72- #[ macro_export]
7359macro_rules! TrivialTypeTraversalImpls {
7460 ( $( $ty: ty) ,+ $( , ) ?) => {
7561 $(
@@ -104,7 +90,6 @@ macro_rules! TrivialTypeTraversalImpls {
10490 } ;
10591}
10692
107- #[ macro_export]
10893macro_rules! TrivialTypeTraversalAndLiftImpls {
10994 ( $( $t: tt) * ) => {
11095 TrivialTypeTraversalImpls ! { $( $t) * }
0 commit comments