Skip to content

Commit e6504df

Browse files
committed
Use PathBuf::from instead of try_from
1 parent 04903b0 commit e6504df

File tree

1 file changed

+1
-7
lines changed
  • compiler/rustc_driver_impl/src

1 file changed

+1
-7
lines changed

compiler/rustc_driver_impl/src/lib.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1314,13 +1314,7 @@ pub fn ice_path() -> &'static Option<PathBuf> {
13141314
let mut path = match std::env::var("RUSTC_ICE").as_deref() {
13151315
// Explicitly opting out of writing ICEs to disk.
13161316
Ok("0") => return None,
1317-
Ok(s) => match PathBuf::try_from(s) {
1318-
Ok(p) => p,
1319-
// On parse error, fallback to the default directory, otherwise the backtraces might be
1320-
// accidentally lost due to a simple typo. The directory might still not be accessible
1321-
// for some other reason.
1322-
Err(_) => std::env::current_dir().unwrap_or_default(),
1323-
},
1317+
Ok(s) => PathBuf::from(s),
13241318
Err(_) => std::env::current_dir().unwrap_or_default(),
13251319
};
13261320
let now: OffsetDateTime = SystemTime::now().into();

0 commit comments

Comments
 (0)