We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 06139e5 commit a2cb8a4Copy full SHA for a2cb8a4
compiler/rustc_serialize/src/opaque.rs
@@ -193,6 +193,8 @@ impl FileEncoder {
193
// shaves an instruction off those code paths (on x86 at least).
194
assert!(capacity <= usize::MAX - max_leb128_len());
195
196
+ // Create the file for reading and writing, because some encoders do both
197
+ // (e.g. the metadata encoder when -Zmeta-stats is enabled)
198
let file = File::options().read(true).write(true).create(true).truncate(true).open(path)?;
199
200
Ok(FileEncoder {
0 commit comments