Skip to content

Commit 21ed43a

Browse files
committed
Mention that the file size limit is only for text files
1 parent 0cf7dbf commit 21ed43a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

compiler/rustc_span/src/source_map.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -116,7 +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-
return Err(io::Error::other("rustc does not support files larger than 4 GiB"));
119+
return Err(io::Error::other("rustc does not support text files larger than 4 GiB"));
120120
}
121121
fs::read_to_string(path)
122122
}
@@ -300,7 +300,7 @@ impl SourceMap {
300300
/// unmodified.
301301
pub fn new_source_file(&self, filename: FileName, src: String) -> Lrc<SourceFile> {
302302
self.try_new_source_file(filename, src).unwrap_or_else(|OffsetOverflowError| {
303-
eprintln!("fatal error: rustc does not support files larger than 4 GiB");
303+
eprintln!("fatal error: rustc does not support text files larger than 4 GiB");
304304
crate::fatal_error::FatalError.raise()
305305
})
306306
}

0 commit comments

Comments
 (0)