@@ -48,7 +48,7 @@ macro_rules! try_validation {
48
48
/// as a kind of validation blacklist:
49
49
///
50
50
/// ```rust
51
- /// let v = try_validation_pat(some_fn(), Foo | Bar | Baz, "some failure", "some place" );
51
+ /// let v = try_validation_pat(some_fn(), Foo | Bar | Baz, "some failure", path );
52
52
/// // Failures that match $p are thrown up as validation errors, but other errors are passed back
53
53
/// // unchanged.
54
54
/// ```
@@ -59,7 +59,7 @@ macro_rules! try_validation_pat {
59
59
// We catch the error and turn it into a validation failure. We are okay with
60
60
// allocation here as this can only slow down builds that fail anyway.
61
61
$( Err ( $p) ) |* if true => throw_validation_failure!( $what, $where $( , $details) ?) ,
62
- Err ( e) => Err :: <!, _>( e) ?,
62
+ Err ( e) => Err :: <!, _>( e) ?,
63
63
}
64
64
} } ;
65
65
}
@@ -843,10 +843,10 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
843
843
// Run it.
844
844
match visitor. visit_value ( op) {
845
845
Ok ( ( ) ) => Ok ( ( ) ) ,
846
- // Allow validation failures to be returned .
846
+ // Pass through validation failures.
847
847
Err ( err) if matches ! ( err. kind, err_ub!( ValidationFailure { .. } ) ) => Err ( err) ,
848
- // Also allow InvalidProgram to be returned, because it's likely that different callers
849
- // will want to do different things in this situation .
848
+ // Also pass through InvalidProgram, those just indicate that we could not
849
+ // validate and each caller will know best what to do with them .
850
850
Err ( err) if matches ! ( err. kind, InterpError :: InvalidProgram ( _) ) => Err ( err) ,
851
851
// Avoid other errors as those do not show *where* in the value the issue lies.
852
852
Err ( err) => bug ! ( "Unexpected error during validation: {}" , err) ,
0 commit comments