@@ -44,7 +44,7 @@ macro_rules! assert_eq {
44
44
// The reborrows below are intentional. Without them, the stack slot for the
45
45
// borrow is initialized even before the values are compared, leading to a
46
46
// noticeable slow down.
47
- panic!( r#"assertion failed: `(left == right)`
47
+ $crate :: panic!( r#"assertion failed: `(left == right)`
48
48
left: `{:?}`,
49
49
right: `{:?}`"# , & * left_val, & * right_val)
50
50
}
@@ -58,7 +58,7 @@ macro_rules! assert_eq {
58
58
// The reborrows below are intentional. Without them, the stack slot for the
59
59
// borrow is initialized even before the values are compared, leading to a
60
60
// noticeable slow down.
61
- panic!( r#"assertion failed: `(left == right)`
61
+ $crate :: panic!( r#"assertion failed: `(left == right)`
62
62
left: `{:?}`,
63
63
right: `{:?}`: {}"# , & * left_val, & * right_val,
64
64
$crate:: format_args!( $( $arg) +) )
@@ -95,7 +95,7 @@ macro_rules! assert_ne {
95
95
// The reborrows below are intentional. Without them, the stack slot for the
96
96
// borrow is initialized even before the values are compared, leading to a
97
97
// noticeable slow down.
98
- panic!( r#"assertion failed: `(left != right)`
98
+ $crate :: panic!( r#"assertion failed: `(left != right)`
99
99
left: `{:?}`,
100
100
right: `{:?}`"# , & * left_val, & * right_val)
101
101
}
@@ -109,7 +109,7 @@ macro_rules! assert_ne {
109
109
// The reborrows below are intentional. Without them, the stack slot for the
110
110
// borrow is initialized even before the values are compared, leading to a
111
111
// noticeable slow down.
112
- panic!( r#"assertion failed: `(left != right)`
112
+ $crate :: panic!( r#"assertion failed: `(left != right)`
113
113
left: `{:?}`,
114
114
right: `{:?}`: {}"# , & * left_val, & * right_val,
115
115
$crate:: format_args!( $( $arg) +) )
@@ -466,7 +466,7 @@ macro_rules! writeln {
466
466
///
467
467
/// # Panics
468
468
///
469
- /// This will always [`panic!`]
469
+ /// This will always [`panic!`].
470
470
///
471
471
/// # Examples
472
472
///
@@ -500,13 +500,13 @@ macro_rules! writeln {
500
500
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
501
501
macro_rules! unreachable {
502
502
( ) => ( {
503
- panic!( "internal error: entered unreachable code" )
503
+ $crate :: panic!( "internal error: entered unreachable code" )
504
504
} ) ;
505
505
( $msg: expr $( , ) ?) => ( {
506
506
$crate:: unreachable!( "{}" , $msg)
507
507
} ) ;
508
508
( $fmt: expr, $( $arg: tt) * ) => ( {
509
- panic!( $crate:: concat!( "internal error: entered unreachable code: " , $fmt) , $( $arg) * )
509
+ $crate :: panic!( $crate:: concat!( "internal error: entered unreachable code: " , $fmt) , $( $arg) * )
510
510
} ) ;
511
511
}
512
512
@@ -515,15 +515,15 @@ macro_rules! unreachable {
515
515
/// This allows your code to type-check, which is useful if you are prototyping or
516
516
/// implementing a trait that requires multiple methods which you don't plan of using all of.
517
517
///
518
- /// The difference between `unimplemented!` and [`todo!`](macro.todo.html) is that while `todo!`
518
+ /// The difference between `unimplemented!` and [`todo!`] is that while `todo!`
519
519
/// conveys an intent of implementing the functionality later and the message is "not yet
520
520
/// implemented", `unimplemented!` makes no such claims. Its message is "not implemented".
521
521
/// Also some IDEs will mark `todo!`s.
522
522
///
523
523
/// # Panics
524
524
///
525
- /// This will always [panic!](macro.panic.html) because `unimplemented!` is just a
526
- /// shorthand for `panic!` with a fixed, specific message.
525
+ /// This will always [` panic!`] because `unimplemented!` is just a shorthand for `panic!` with a
526
+ /// fixed, specific message.
527
527
///
528
528
/// Like `panic!`, this macro has a second form for displaying custom values.
529
529
///
@@ -584,8 +584,8 @@ macro_rules! unreachable {
584
584
#[ macro_export]
585
585
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
586
586
macro_rules! unimplemented {
587
- ( ) => ( panic!( "not implemented" ) ) ;
588
- ( $( $arg: tt) +) => ( panic!( "not implemented: {}" , $crate:: format_args!( $( $arg) +) ) ) ;
587
+ ( ) => ( $crate :: panic!( "not implemented" ) ) ;
588
+ ( $( $arg: tt) +) => ( $crate :: panic!( "not implemented: {}" , $crate:: format_args!( $( $arg) +) ) ) ;
589
589
}
590
590
591
591
/// Indicates unfinished code.
@@ -600,7 +600,7 @@ macro_rules! unimplemented {
600
600
///
601
601
/// # Panics
602
602
///
603
- /// This will always [panic!](macro.panic.html)
603
+ /// This will always [` panic!`].
604
604
///
605
605
/// # Examples
606
606
///
@@ -645,8 +645,8 @@ macro_rules! unimplemented {
645
645
#[ macro_export]
646
646
#[ stable( feature = "todo_macro" , since = "1.40.0" ) ]
647
647
macro_rules! todo {
648
- ( ) => ( panic!( "not yet implemented" ) ) ;
649
- ( $( $arg: tt) +) => ( panic!( "not yet implemented: {}" , $crate:: format_args!( $( $arg) +) ) ) ;
648
+ ( ) => ( $crate :: panic!( "not yet implemented" ) ) ;
649
+ ( $( $arg: tt) +) => ( $crate :: panic!( "not yet implemented: {}" , $crate:: format_args!( $( $arg) +) ) ) ;
650
650
}
651
651
652
652
/// Definitions of built-in macros.
0 commit comments