@@ -26,25 +26,22 @@ use super::{
26
26
27
27
macro_rules! throw_validation_failure {
28
28
( $where: expr, { $( $what_fmt: expr ) ,+ } $( expected { $( $expected_fmt: expr ) ,+ } ) ?) => { {
29
- let ( path, msg) = rustc_middle:: ty:: print:: with_no_trimmed_paths( || {
30
- let mut msg = String :: new( ) ;
31
- msg. push_str( "encountered " ) ;
32
- write!( & mut msg, $( $what_fmt) ,+) . unwrap( ) ;
33
- $(
34
- msg. push_str( ", but expected " ) ;
35
- write!( & mut msg, $( $expected_fmt) ,+) . unwrap( ) ;
36
- ) ?
37
-
29
+ let mut msg = String :: new( ) ;
30
+ msg. push_str( "encountered " ) ;
31
+ write!( & mut msg, $( $what_fmt) ,+) . unwrap( ) ;
32
+ $(
33
+ msg. push_str( ", but expected " ) ;
34
+ write!( & mut msg, $( $expected_fmt) ,+) . unwrap( ) ;
35
+ ) ?
36
+ let path = rustc_middle:: ty:: print:: with_no_trimmed_paths( || {
38
37
let where_ = & $where;
39
- let path = if !where_. is_empty( ) {
38
+ if !where_. is_empty( ) {
40
39
let mut path = String :: new( ) ;
41
40
write_path( & mut path, where_) ;
42
41
Some ( path)
43
42
} else {
44
43
None
45
- } ;
46
-
47
- ( path, msg)
44
+ }
48
45
} ) ;
49
46
throw_ub!( ValidationFailure { path, msg } )
50
47
} } ;
0 commit comments