File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -131,7 +131,7 @@ features = [
131131tokio-test = { version = " 0.4.0" , path = " ../tokio-test" }
132132tokio-stream = { version = " 0.1" , path = " ../tokio-stream" }
133133futures = { version = " 0.3.0" , features = [" async-await" ] }
134- mockall = " 0.11.1 "
134+ mockall = " 0.13.0 "
135135async-stream = " 0.3"
136136futures-concurrency = " 7.6.3"
137137
Original file line number Diff line number Diff line change @@ -62,6 +62,13 @@ impl Read for MockFile {
6262
6363impl Read for & ' _ MockFile {
6464 fn read ( & mut self , dst : & mut [ u8 ] ) -> io:: Result < usize > {
65+ // Placate Miri. Tokio will call this method with an uninitialized
66+ // buffer, which is ok because std::io::Read::read implementations don't usually read
67+ // from their input buffers. But Mockall 0.12-0.13 will try to Debug::fmt the
68+ // buffer, even if there is no failure, triggering an uninitialized data access alert from
69+ // Miri. Initialize the data here just to prevent those Miri alerts.
70+ // This can be removed after upgrading to Mockall 0.14.
71+ dst. fill ( 0 ) ;
6572 self . inner_read ( dst)
6673 }
6774}
You can’t perform that action at this time.
0 commit comments