@@ -39,10 +39,12 @@ macro_rules! assert_eq {
39
39
( left_val, right_val) => {
40
40
if !( * left_val == * right_val) {
41
41
let kind = $crate:: panicking:: AssertKind :: Eq ;
42
+ let left_name = stringify!( $left) ;
43
+ let right_name = stringify!( $right) ;
42
44
// The reborrows below are intentional. Without them, the stack slot for the
43
45
// borrow is initialized even before the values are compared, leading to a
44
46
// 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 ) ;
46
48
}
47
49
}
48
50
}
@@ -52,10 +54,12 @@ macro_rules! assert_eq {
52
54
( left_val, right_val) => {
53
55
if !( * left_val == * right_val) {
54
56
let kind = $crate:: panicking:: AssertKind :: Eq ;
57
+ let left_name = stringify!( $left) ;
58
+ let right_name = stringify!( $right) ;
55
59
// The reborrows below are intentional. Without them, the stack slot for the
56
60
// borrow is initialized even before the values are compared, leading to a
57
61
// 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) +) ) ) ;
59
63
}
60
64
}
61
65
}
@@ -89,10 +93,12 @@ macro_rules! assert_ne {
89
93
( left_val, right_val) => {
90
94
if * left_val == * right_val {
91
95
let kind = $crate:: panicking:: AssertKind :: Ne ;
96
+ let left_name = stringify!( $left) ;
97
+ let right_name = stringify!( $right) ;
92
98
// The reborrows below are intentional. Without them, the stack slot for the
93
99
// borrow is initialized even before the values are compared, leading to a
94
100
// 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 ) ;
96
102
}
97
103
}
98
104
}
@@ -102,10 +108,12 @@ macro_rules! assert_ne {
102
108
( left_val, right_val) => {
103
109
if * left_val == * right_val {
104
110
let kind = $crate:: panicking:: AssertKind :: Ne ;
111
+ let left_name = stringify!( $left) ;
112
+ let right_name = stringify!( $right) ;
105
113
// The reborrows below are intentional. Without them, the stack slot for the
106
114
// borrow is initialized even before the values are compared, leading to a
107
115
// 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) +) ) ) ;
109
117
}
110
118
}
111
119
}
0 commit comments