@@ -42,7 +42,7 @@ macro_rules! throw_validation_failure {
42
42
macro_rules! try_validation {
43
43
( $e: expr, $what: expr, $where: expr $( , $expected: expr ) ?) => { {
44
44
try_validation_pat!( $e, $where, {
45
- _ => { "{}" , $what } $( expected { $expected } ) ?,
45
+ _ => { "{}" , $what } $( expected { "{}" , $expected } ) ?,
46
46
} )
47
47
} } ;
48
48
}
@@ -67,12 +67,12 @@ macro_rules! try_validation {
67
67
/// ```
68
68
///
69
69
macro_rules! try_validation_pat {
70
- ( $e: expr, $where: expr, { $( $p: pat ) |* => { $( $what_fmt: expr ) ,* } $( expected { $expected : expr } ) ? $( , ) ?} ) => { {
70
+ ( $e: expr, $where: expr, { $( $p: pat ) |* => { $( $what_fmt: expr ) ,* } $( expected { $( $expected_fmt : expr ) , * } ) ? $( , ) ?} ) => { {
71
71
match $e {
72
72
Ok ( x) => x,
73
73
// We catch the error and turn it into a validation failure. We are okay with
74
74
// allocation here as this can only slow down builds that fail anyway.
75
- $( Err ( InterpErrorInfo { kind: $p, .. } ) ) |* => throw_validation_failure!( format_args!( $( $what_fmt ) ,* ) , $where $( , $expected ) ?) ,
75
+ $( Err ( InterpErrorInfo { kind: $p, .. } ) ) |* => throw_validation_failure!( format_args!( $( $what_fmt ) ,* ) , $where $( , format_args! ( $ ( $expected_fmt ) , * ) ) ?) ,
76
76
#[ allow( unreachable_patterns) ]
77
77
Err ( e) => Err :: <!, _>( e) ?,
78
78
}
0 commit comments