File tree 1 file changed +6
-2
lines changed
1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -403,8 +403,12 @@ const RUSTFIX_COVERAGE_KNOWN_EXCEPTIONS: &[&str] = &[
403
403
] ;
404
404
405
405
fn check_rustfix_coverage ( ) {
406
- let target_dir = PathBuf :: from ( std:: env:: var ( "CARGO_TARGET_DIR" ) . unwrap ( ) ) ;
407
- let missing_coverage_path = target_dir. join ( "debug/test/ui/rustfix_missing_coverage.txt" ) ;
406
+ let missing_coverage_path = Path :: new ( "debug/test/ui/rustfix_missing_coverage.txt" ) ;
407
+ let missing_coverage_path = if let Ok ( target_dir) = std:: env:: var ( "CARGO_TARGET_DIR" ) {
408
+ PathBuf :: from ( target_dir) . join ( missing_coverage_path)
409
+ } else {
410
+ missing_coverage_path. to_path_buf ( )
411
+ } ;
408
412
409
413
if let Ok ( missing_coverage_contents) = std:: fs:: read_to_string ( missing_coverage_path) {
410
414
assert ! ( RUSTFIX_COVERAGE_KNOWN_EXCEPTIONS . iter( ) . is_sorted_by_key( Path :: new) ) ;
You can’t perform that action at this time.
0 commit comments