impl Read for MockFile { fn read(&mutself, dst: &mut [u8]) -> io::Result<usize> { // Placate Miri. Tokio will call this method with an uninitialized // buffer, which is ok because std::io::Read::read implementations don't usually read // from their input buffers. But Mockall 0.12-0.13 will try to Debug::fmt the // buffer, even if there is no failure, triggering an uninitialized data access alert from // Miri. Initialize the data here just to prevent those Miri alerts. // This can be removed after upgrading to Mockall 0.14.
dst.fill(0); self.inner_read(dst)
}
}
impl Read for &'_ MockFile { fn read(&mutself, dst: &mut [u8]) -> io::Result<usize> { // Placate Miri. Tokio will call this method with an uninitialized // buffer, which is ok because std::io::Read::read implementations don't usually read // from their input buffers. But Mockall 0.12-0.13 will try to Debug::fmt the // buffer, even if there is no failure, triggering an uninitialized data access alert from // Miri. Initialize the data here just to prevent those Miri alerts. // This can be removed after upgrading to Mockall 0.14.
dst.fill(0); self.inner_read(dst)
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.