@@ -41,7 +41,14 @@ macro_rules! assert_eq {
4141 // The reborrows below are intentional. Without them, the stack slot for the
4242 // borrow is initialized even before the values are compared, leading to a
4343 // noticeable slow down.
44- $crate:: panicking:: assert_failed( kind, & * left_val, & * right_val, $crate:: option:: Option :: None ) ;
44+ $crate:: panicking:: assert_failed(
45+ kind,
46+ $crate:: stringify!( $left) ,
47+ & * left_val,
48+ $crate:: stringify!( $right) ,
49+ & * right_val,
50+ $crate:: option:: Option :: None ,
51+ ) ;
4552 }
4653 }
4754 }
@@ -54,7 +61,14 @@ macro_rules! assert_eq {
5461 // The reborrows below are intentional. Without them, the stack slot for the
5562 // borrow is initialized even before the values are compared, leading to a
5663 // noticeable slow down.
57- $crate:: panicking:: assert_failed( kind, & * left_val, & * right_val, $crate:: option:: Option :: Some ( $crate:: format_args!( $( $arg) +) ) ) ;
64+ $crate:: panicking:: assert_failed(
65+ kind,
66+ $crate:: stringify!( $left) ,
67+ & * left_val,
68+ $crate:: stringify!( $right) ,
69+ & * right_val,
70+ $crate:: option:: Option :: Some ( $crate:: format_args!( $( $arg) +) ) ,
71+ ) ;
5872 }
5973 }
6074 }
@@ -90,7 +104,14 @@ macro_rules! assert_ne {
90104 // The reborrows below are intentional. Without them, the stack slot for the
91105 // borrow is initialized even before the values are compared, leading to a
92106 // noticeable slow down.
93- $crate:: panicking:: assert_failed( kind, & * left_val, & * right_val, $crate:: option:: Option :: None ) ;
107+ $crate:: panicking:: assert_failed(
108+ kind,
109+ $crate:: stringify!( $left) ,
110+ & * left_val,
111+ $crate:: stringify!( $right) ,
112+ & * right_val,
113+ $crate:: option:: Option :: None ,
114+ ) ;
94115 }
95116 }
96117 }
@@ -103,7 +124,14 @@ macro_rules! assert_ne {
103124 // The reborrows below are intentional. Without them, the stack slot for the
104125 // borrow is initialized even before the values are compared, leading to a
105126 // noticeable slow down.
106- $crate:: panicking:: assert_failed( kind, & * left_val, & * right_val, $crate:: option:: Option :: Some ( $crate:: format_args!( $( $arg) +) ) ) ;
127+ $crate:: panicking:: assert_failed(
128+ kind,
129+ $crate:: stringify!( $left) ,
130+ & * left_val,
131+ $crate:: stringify!( $right) ,
132+ & * right_val,
133+ $crate:: option:: Option :: Some ( $crate:: format_args!( $( $arg) +) ) ,
134+ ) ;
107135 }
108136 }
109137 }
@@ -145,6 +173,7 @@ pub macro assert_matches {
145173 $( $pattern ) |+ $( if $guard ) ? => { }
146174 ref left_val => {
147175 $crate:: panicking:: assert_matches_failed (
176+ $crate:: stringify!( $left) ,
148177 left_val,
149178 $crate:: stringify!( $( $pattern) |+ $( if $guard) ?) ,
150179 $crate:: option:: Option :: None
@@ -157,6 +186,7 @@ pub macro assert_matches {
157186 $( $pattern ) |+ $( if $guard ) ? => { }
158187 ref left_val => {
159188 $crate:: panicking:: assert_matches_failed (
189+ $crate:: stringify!( $left) ,
160190 left_val,
161191 $crate:: stringify!( $( $pattern) |+ $( if $guard) ?) ,
162192 $crate:: option:: Option :: Some ( $crate:: format_args!( $( $arg) +) )
0 commit comments