Skip to content

Commit bd81023

Browse files
authored
Rollup merge of #134074 - GrigorenkoPV:bootstrap-io-error-more, r=jieyouxu
bootstrap: `std::io::ErrorKind::CrossesDevices` is finally stable
2 parents a2d7c81 + 4ba139d commit bd81023

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/bootstrap/src/utils/helpers.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -181,10 +181,7 @@ pub fn symlink_dir(config: &Config, original: &Path, link: &Path) -> io::Result<
181181
/// copy and remove the file otherwise
182182
pub fn move_file<P: AsRef<Path>, Q: AsRef<Path>>(from: P, to: Q) -> io::Result<()> {
183183
match fs::rename(&from, &to) {
184-
// FIXME: Once `ErrorKind::CrossesDevices` is stabilized use
185-
// if e.kind() == io::ErrorKind::CrossesDevices {
186-
#[cfg(unix)]
187-
Err(e) if e.raw_os_error() == Some(libc::EXDEV) => {
184+
Err(e) if e.kind() == io::ErrorKind::CrossesDevices => {
188185
std::fs::copy(&from, &to)?;
189186
std::fs::remove_file(&from)
190187
}

0 commit comments

Comments
 (0)