seek before counting zero bytes
This commit is contained in:
parent
1ead92dd64
commit
e11dd802c1
@ -40,7 +40,7 @@ use rustc_span::{
|
|||||||
use rustc_target::abi::VariantIdx;
|
use rustc_target::abi::VariantIdx;
|
||||||
use std::borrow::Borrow;
|
use std::borrow::Borrow;
|
||||||
use std::hash::Hash;
|
use std::hash::Hash;
|
||||||
use std::io::{Read, Write};
|
use std::io::{Read, Seek, Write};
|
||||||
use std::iter;
|
use std::iter;
|
||||||
use std::num::NonZeroUsize;
|
use std::num::NonZeroUsize;
|
||||||
use std::path::{Path, PathBuf};
|
use std::path::{Path, PathBuf};
|
||||||
@ -735,6 +735,7 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> {
|
|||||||
|
|
||||||
if tcx.sess.meta_stats() {
|
if tcx.sess.meta_stats() {
|
||||||
let mut zero_bytes = 0;
|
let mut zero_bytes = 0;
|
||||||
|
self.opaque.file().seek(std::io::SeekFrom::Start(0)).unwrap();
|
||||||
let file = std::io::BufReader::new(self.opaque.file());
|
let file = std::io::BufReader::new(self.opaque.file());
|
||||||
for e in file.bytes() {
|
for e in file.bytes() {
|
||||||
if e.unwrap() == 0 {
|
if e.unwrap() == 0 {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user