22///
33/// For details, see `std::macros`.
44#[ macro_export]
5- #[ allow_internal_unstable( core_panic, __rust_unstable_column ) ]
5+ #[ allow_internal_unstable( core_panic) ]
66#[ stable( feature = "core" , since = "1.6.0" ) ]
77macro_rules! panic {
88 ( ) => (
99 $crate:: panic!( "explicit panic" )
1010 ) ;
1111 ( $msg: expr) => ( {
12- $crate:: panicking:: panic( & ( $msg, file!( ) , line!( ) , __rust_unstable_column !( ) ) )
12+ $crate:: panicking:: panic( & ( $msg, $crate :: file!( ) , $crate :: line!( ) , $crate :: column !( ) ) )
1313 } ) ;
1414 ( $msg: expr, ) => (
1515 $crate:: panic!( $msg)
1616 ) ;
1717 ( $fmt: expr, $( $arg: tt) +) => ( {
18- $crate:: panicking:: panic_fmt( format_args!( $fmt, $( $arg) +) ,
19- & ( file!( ) , line!( ) , __rust_unstable_column !( ) ) )
18+ $crate:: panicking:: panic_fmt( $crate :: format_args!( $fmt, $( $arg) +) ,
19+ & ( $crate :: file!( ) , $crate :: line!( ) , $crate :: column !( ) ) )
2020 } ) ;
2121}
2222
@@ -70,7 +70,7 @@ macro_rules! assert_eq {
7070 panic!( r#"assertion failed: `(left == right)`
7171 left: `{:?}`,
7272 right: `{:?}`: {}"# , & * left_val, & * right_val,
73- format_args!( $( $arg) +) )
73+ $crate :: format_args!( $( $arg) +) )
7474 }
7575 }
7676 }
@@ -127,7 +127,7 @@ macro_rules! assert_ne {
127127 panic!( r#"assertion failed: `(left != right)`
128128 left: `{:?}`,
129129 right: `{:?}`: {}"# , & * left_val, & * right_val,
130- format_args!( $( $arg) +) )
130+ $crate :: format_args!( $( $arg) +) )
131131 }
132132 }
133133 }
@@ -181,7 +181,7 @@ macro_rules! assert_ne {
181181#[ macro_export]
182182#[ stable( feature = "rust1" , since = "1.0.0" ) ]
183183macro_rules! debug_assert {
184- ( $( $arg: tt) * ) => ( if cfg!( debug_assertions) { assert!( $( $arg) * ) ; } )
184+ ( $( $arg: tt) * ) => ( if $crate :: cfg!( debug_assertions) { $crate :: assert!( $( $arg) * ) ; } )
185185}
186186
187187/// Asserts that two expressions are equal to each other.
@@ -208,7 +208,7 @@ macro_rules! debug_assert {
208208#[ macro_export]
209209#[ stable( feature = "rust1" , since = "1.0.0" ) ]
210210macro_rules! debug_assert_eq {
211- ( $( $arg: tt) * ) => ( if cfg!( debug_assertions) { $crate:: assert_eq!( $( $arg) * ) ; } )
211+ ( $( $arg: tt) * ) => ( if $crate :: cfg!( debug_assertions) { $crate:: assert_eq!( $( $arg) * ) ; } )
212212}
213213
214214/// Asserts that two expressions are not equal to each other.
@@ -235,7 +235,7 @@ macro_rules! debug_assert_eq {
235235#[ macro_export]
236236#[ stable( feature = "assert_ne" , since = "1.13.0" ) ]
237237macro_rules! debug_assert_ne {
238- ( $( $arg: tt) * ) => ( if cfg!( debug_assertions) { $crate:: assert_ne!( $( $arg) * ) ; } )
238+ ( $( $arg: tt) * ) => ( if $crate :: cfg!( debug_assertions) { $crate:: assert_ne!( $( $arg) * ) ; } )
239239}
240240
241241/// Unwraps a result or propagates its error.
@@ -386,7 +386,7 @@ macro_rules! r#try {
386386#[ macro_export]
387387#[ stable( feature = "rust1" , since = "1.0.0" ) ]
388388macro_rules! write {
389- ( $dst: expr, $( $arg: tt) * ) => ( $dst. write_fmt( format_args!( $( $arg) * ) ) )
389+ ( $dst: expr, $( $arg: tt) * ) => ( $dst. write_fmt( $crate :: format_args!( $( $arg) * ) ) )
390390}
391391
392392/// Write formatted data into a buffer, with a newline appended.
@@ -446,7 +446,7 @@ macro_rules! writeln {
446446 $crate:: writeln!( $dst)
447447 ) ;
448448 ( $dst: expr, $( $arg: tt) * ) => (
449- $dst. write_fmt( format_args_nl!( $( $arg) * ) )
449+ $dst. write_fmt( $crate :: format_args_nl!( $( $arg) * ) )
450450 ) ;
451451}
452452
@@ -515,7 +515,7 @@ macro_rules! unreachable {
515515 $crate:: unreachable!( $msg)
516516 } ) ;
517517 ( $fmt: expr, $( $arg: tt) * ) => ( {
518- panic!( concat!( "internal error: entered unreachable code: " , $fmt) , $( $arg) * )
518+ panic!( $crate :: concat!( "internal error: entered unreachable code: " , $fmt) , $( $arg) * )
519519 } ) ;
520520}
521521
@@ -573,7 +573,7 @@ macro_rules! unreachable {
573573#[ stable( feature = "rust1" , since = "1.0.0" ) ]
574574macro_rules! unimplemented {
575575 ( ) => ( panic!( "not yet implemented" ) ) ;
576- ( $( $arg: tt) +) => ( panic!( "not yet implemented: {}" , format_args!( $( $arg) +) ) ) ;
576+ ( $( $arg: tt) +) => ( panic!( "not yet implemented: {}" , $crate :: format_args!( $( $arg) +) ) ) ;
577577}
578578
579579/// Indicates unfinished code.
@@ -632,7 +632,7 @@ macro_rules! unimplemented {
632632#[ unstable( feature = "todo_macro" , issue = "59277" ) ]
633633macro_rules! todo {
634634 ( ) => ( panic!( "not yet implemented" ) ) ;
635- ( $( $arg: tt) +) => ( panic!( "not yet implemented: {}" , format_args!( $( $arg) +) ) ) ;
635+ ( $( $arg: tt) +) => ( panic!( "not yet implemented: {}" , $crate :: format_args!( $( $arg) +) ) ) ;
636636}
637637
638638/// Definitions of built-in macros.
@@ -927,13 +927,6 @@ pub(crate) mod builtin {
927927 #[ macro_export]
928928 macro_rules! column { ( ) => { /* compiler built-in */ } }
929929
930- /// Same as `column`, but less likely to be shadowed.
931- #[ unstable( feature = "__rust_unstable_column" , issue = "0" ,
932- reason = "internal implementation detail of the `panic` macro" ) ]
933- #[ rustc_builtin_macro]
934- #[ macro_export]
935- macro_rules! __rust_unstable_column { ( ) => { /* compiler built-in */ } }
936-
937930 /// Expands to the file name in which it was invoked.
938931 ///
939932 /// With [`line!`] and [`column!`], these macros provide debugging information for
0 commit comments