@@ -39,10 +39,12 @@ macro_rules! assert_eq {
3939 ( left_val, right_val) => {
4040 if !( * left_val == * right_val) {
4141 let kind = $crate:: panicking:: AssertKind :: Eq ;
42+ let left_name = stringify!( $left) ;
43+ let right_name = stringify!( $right) ;
4244 // The reborrows below are intentional. Without them, the stack slot for the
4345 // borrow is initialized even before the values are compared, leading to a
4446 // noticeable slow down.
45- $crate:: panicking:: assert_failed( kind, & * left_val, & * right_val, $crate:: option:: Option :: None ) ;
47+ $crate:: panicking:: assert_failed( kind, & * left_val, & * right_val, left_name , right_name , $crate:: option:: Option :: None ) ;
4648 }
4749 }
4850 }
@@ -52,10 +54,12 @@ macro_rules! assert_eq {
5254 ( left_val, right_val) => {
5355 if !( * left_val == * right_val) {
5456 let kind = $crate:: panicking:: AssertKind :: Eq ;
57+ let left_name = stringify!( $left) ;
58+ let right_name = stringify!( $right) ;
5559 // The reborrows below are intentional. Without them, the stack slot for the
5660 // borrow is initialized even before the values are compared, leading to a
5761 // noticeable slow down.
58- $crate:: panicking:: assert_failed( kind, & * left_val, & * right_val, $crate:: option:: Option :: Some ( $crate:: format_args!( $( $arg) +) ) ) ;
62+ $crate:: panicking:: assert_failed( kind, & * left_val, & * right_val, left_name , right_name , $crate:: option:: Option :: Some ( $crate:: format_args!( $( $arg) +) ) ) ;
5963 }
6064 }
6165 }
@@ -89,10 +93,12 @@ macro_rules! assert_ne {
8993 ( left_val, right_val) => {
9094 if * left_val == * right_val {
9195 let kind = $crate:: panicking:: AssertKind :: Ne ;
96+ let left_name = stringify!( $left) ;
97+ let right_name = stringify!( $right) ;
9298 // The reborrows below are intentional. Without them, the stack slot for the
9399 // borrow is initialized even before the values are compared, leading to a
94100 // noticeable slow down.
95- $crate:: panicking:: assert_failed( kind, & * left_val, & * right_val, $crate:: option:: Option :: None ) ;
101+ $crate:: panicking:: assert_failed( kind, & * left_val, & * right_val, left_name , right_name , $crate:: option:: Option :: None ) ;
96102 }
97103 }
98104 }
@@ -102,10 +108,12 @@ macro_rules! assert_ne {
102108 ( left_val, right_val) => {
103109 if * left_val == * right_val {
104110 let kind = $crate:: panicking:: AssertKind :: Ne ;
111+ let left_name = stringify!( $left) ;
112+ let right_name = stringify!( $right) ;
105113 // The reborrows below are intentional. Without them, the stack slot for the
106114 // borrow is initialized even before the values are compared, leading to a
107115 // noticeable slow down.
108- $crate:: panicking:: assert_failed( kind, & * left_val, & * right_val, $crate:: option:: Option :: Some ( $crate:: format_args!( $( $arg) +) ) ) ;
116+ $crate:: panicking:: assert_failed( kind, & * left_val, & * right_val, left_name , right_name , $crate:: option:: Option :: Some ( $crate:: format_args!( $( $arg) +) ) ) ;
109117 }
110118 }
111119 }
0 commit comments