Skip to content

Commit 0cf7dbf

Browse files
committed
Use io::Error
1 parent 532e3f6 commit 0cf7dbf

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

compiler/rustc_span/src/source_map.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,7 @@ impl FileLoader for RealFileLoader {
116116

117117
fn read_file(&self, path: &Path) -> io::Result<String> {
118118
if path.metadata().is_ok_and(|metadata| metadata.len() > u32::MAX.into()) {
119-
eprintln!("fatal error: rustc does not support files larger than 4 GiB");
120-
crate::fatal_error::FatalError.raise()
119+
return Err(io::Error::other("rustc does not support files larger than 4 GiB"));
121120
}
122121
fs::read_to_string(path)
123122
}

0 commit comments

Comments
 (0)