Skip to content

Commit a2cb8a4

Browse files
author
Sikkema, Isaac
committed
add comment explaining read permissions
1 parent 06139e5 commit a2cb8a4

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

compiler/rustc_serialize/src/opaque.rs

+2
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,8 @@ impl FileEncoder {
193193
// shaves an instruction off those code paths (on x86 at least).
194194
assert!(capacity <= usize::MAX - max_leb128_len());
195195

196+
// Create the file for reading and writing, because some encoders do both
197+
// (e.g. the metadata encoder when -Zmeta-stats is enabled)
196198
let file = File::options().read(true).write(true).create(true).truncate(true).open(path)?;
197199

198200
Ok(FileEncoder {

0 commit comments

Comments
 (0)