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