diff --git a/src/tools/compiletest/src/json.rs b/src/tools/compiletest/src/json.rs index 43b5572dfd6..073b5e57cc7 100644 --- a/src/tools/compiletest/src/json.rs +++ b/src/tools/compiletest/src/json.rs @@ -181,7 +181,7 @@ fn push_expected_errors(expected_errors: &mut Vec, fn push_backtrace(expected_errors: &mut Vec, expansion: &DiagnosticSpanMacroExpansion, file_name: &str) { - if expansion.span.file_name == file_name { + if Path::new(&expansion.span.file_name) == Path::new(&file_name) { expected_errors.push( Error { line_num: expansion.span.line_start,