diff --git a/src/tools/tidy/src/error_codes.rs b/src/tools/tidy/src/error_codes.rs index b766f1667181..026f7d87418a 100644 --- a/src/tools/tidy/src/error_codes.rs +++ b/src/tools/tidy/src/error_codes.rs @@ -61,8 +61,9 @@ pub fn check(root_path: &Path, search_paths: &[&Path], bad: &mut bool) { /// Stage 1: Parses a list of error codes from `error_codes.rs`. fn extract_error_codes(root_path: &Path, errors: &mut Vec) -> Vec { - let file = fs::read_to_string(root_path.join(Path::new(ERROR_CODES_PATH))) - .unwrap_or_else(|e| panic!("failed to read `error_codes.rs`: {e}")); + let path = root_path.join(Path::new(ERROR_CODES_PATH)); + let file = + fs::read_to_string(&path).unwrap_or_else(|e| panic!("failed to read `{path:?}`: {e}")); let mut error_codes = Vec::new(); let mut reached_undocumented_codes = false; @@ -97,7 +98,8 @@ fn extract_error_codes(root_path: &Path, errors: &mut Vec) -> Vec file, Err(err) => { println!( - "WARNING: Failed to read UI test file for `{code}` but the file exists. The test is assumed to work:\n{err}" + "WARNING: Failed to read UI test file (`{test_path}`) for `{code}` but the file exists. The test is assumed to work:\n{err}" ); continue; }