Skip to content

Commit

Permalink
Ignore unexpected incr-comp session dirs
Browse files Browse the repository at this point in the history
Clearly the code path can be hit without the presence of a compiler bug.
All it takes is mischief. See 71698.

Ignore problematic directories instead of ICE:ing. `continue`ing is
already done for problematic dirs in the code block above us.
  • Loading branch information
Enselic committed Aug 18, 2023
1 parent df8aed4 commit 64e8aea
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions compiler/rustc_incremental/src/persist/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -538,9 +538,13 @@ where
continue;
}

let timestamp = extract_timestamp_from_session_dir(&directory_name).unwrap_or_else(|e| {
bug!("unexpected incr-comp session dir: {}: {}", session_dir.display(), e)
});
let timestamp = match extract_timestamp_from_session_dir(&directory_name) {
Ok(timestamp) => timestamp,
Err(e) => {
debug!("unexpected incr-comp session dir: {}: {}", session_dir.display(), e);
continue;
}
};

if timestamp > best_candidate.0 {
best_candidate = (timestamp, Some(session_dir.clone()));
Expand Down

0 comments on commit 64e8aea

Please sign in to comment.