mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-29 00:00:11 +02:00
fs: update the mockall dev dependency to 0.13.0 (#7234)
This commit is contained in:
+1
-1
@@ -131,7 +131,7 @@ features = [
|
|||||||
tokio-test = { version = "0.4.0", path = "../tokio-test" }
|
tokio-test = { version = "0.4.0", path = "../tokio-test" }
|
||||||
tokio-stream = { version = "0.1", path = "../tokio-stream" }
|
tokio-stream = { version = "0.1", path = "../tokio-stream" }
|
||||||
futures = { version = "0.3.0", features = ["async-await"] }
|
futures = { version = "0.3.0", features = ["async-await"] }
|
||||||
mockall = "0.11.1"
|
mockall = "0.13.0"
|
||||||
async-stream = "0.3"
|
async-stream = "0.3"
|
||||||
futures-concurrency = "7.6.3"
|
futures-concurrency = "7.6.3"
|
||||||
|
|
||||||
|
|||||||
@@ -62,6 +62,13 @@ impl Read for MockFile {
|
|||||||
|
|
||||||
impl Read for &'_ MockFile {
|
impl Read for &'_ MockFile {
|
||||||
fn read(&mut self, dst: &mut [u8]) -> io::Result<usize> {
|
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)
|
self.inner_read(dst)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user