fs: update the mockall dev dependency to 0.13.0 (#7234)

This commit is contained in:
Alan Somers
2025-04-23 11:13:10 +02:00
committed by GitHub
parent 1434b32b5a
commit 5490267a79
2 changed files with 8 additions and 1 deletions
+1 -1
View File
@@ -131,7 +131,7 @@ features = [
tokio-test = { version = "0.4.0", path = "../tokio-test" }
tokio-stream = { version = "0.1", path = "../tokio-stream" }
futures = { version = "0.3.0", features = ["async-await"] }
mockall = "0.11.1"
mockall = "0.13.0"
async-stream = "0.3"
futures-concurrency = "7.6.3"
+7
View File
@@ -62,6 +62,13 @@ impl Read for MockFile {
impl Read for &'_ MockFile {
fn read(&mut self, 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)
}
}