@@ -48,7 +48,7 @@ macro_rules! try_validation {
4848/// as a kind of validation blacklist:
4949///
5050/// ```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 );
5252/// // Failures that match $p are thrown up as validation errors, but other errors are passed back
5353/// // unchanged.
5454/// ```
@@ -59,7 +59,7 @@ macro_rules! try_validation_pat {
5959 // We catch the error and turn it into a validation failure. We are okay with
6060 // allocation here as this can only slow down builds that fail anyway.
6161 $( Err ( $p) ) |* if true => throw_validation_failure!( $what, $where $( , $details) ?) ,
62- Err ( e) => Err :: <!, _>( e) ?,
62+ Err ( e) => Err :: <!, _>( e) ?,
6363 }
6464 } } ;
6565}
@@ -843,10 +843,10 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
843843 // Run it.
844844 match visitor. visit_value ( op) {
845845 Ok ( ( ) ) => Ok ( ( ) ) ,
846- // Allow validation failures to be returned .
846+ // Pass through validation failures.
847847 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 .
850850 Err ( err) if matches ! ( err. kind, InterpError :: InvalidProgram ( _) ) => Err ( err) ,
851851 // Avoid other errors as those do not show *where* in the value the issue lies.
852852 Err ( err) => bug ! ( "Unexpected error during validation: {}" , err) ,
0 commit comments