1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132
|
Index: tokio/Cargo.toml
===================================================================
--- tokio.orig/Cargo.toml
+++ tokio/Cargo.toml
@@ -788,9 +788,6 @@ features = ["async-await"]
[dev-dependencies.futures-concurrency]
version = "7.6.3"
-[dev-dependencies.mockall]
-version = "0.13.0"
-
[dev-dependencies.tokio-stream]
version = "0.1"
Index: tokio/src/fs/file.rs
===================================================================
--- tokio.orig/src/fs/file.rs
+++ tokio/src/fs/file.rs
@@ -17,17 +17,17 @@ use std::pin::Pin;
use std::sync::Arc;
use std::task::{ready, Context, Poll};
-#[cfg(test)]
+/*#[cfg(test)]
use super::mocks::JoinHandle;
#[cfg(test)]
use super::mocks::MockFile as StdFile;
#[cfg(test)]
-use super::mocks::{spawn_blocking, spawn_mandatory_blocking};
-#[cfg(not(test))]
+use super::mocks::{spawn_blocking, spawn_mandatory_blocking};*/
+//#[cfg(not(test))]
use crate::blocking::JoinHandle;
-#[cfg(not(test))]
+//#[cfg(not(test))]
use crate::blocking::{spawn_blocking, spawn_mandatory_blocking};
-#[cfg(not(test))]
+//#[cfg(not(test))]
use std::fs::File as StdFile;
/// A reference to an open file on the filesystem.
@@ -987,5 +987,5 @@ impl Inner {
}
}
-#[cfg(test)]
-mod tests;
+//#[cfg(test)]
+//mod tests;
Index: tokio/src/fs/mod.rs
===================================================================
--- tokio.orig/src/fs/mod.rs
+++ tokio/src/fs/mod.rs
@@ -280,8 +280,8 @@ pub use self::copy::copy;
mod try_exists;
pub use self::try_exists::try_exists;
-#[cfg(test)]
-mod mocks;
+//#[cfg(test)]
+//mod mocks;
feature! {
#![unix]
@@ -300,10 +300,10 @@ cfg_windows! {
use std::io;
-#[cfg(not(test))]
+//#[cfg(not(test))]
use crate::blocking::spawn_blocking;
-#[cfg(test)]
-use mocks::spawn_blocking;
+//#[cfg(test)]
+//use mocks::spawn_blocking;
pub(crate) async fn asyncify<F, T>(f: F) -> io::Result<T>
where
Index: tokio/src/fs/open_options.rs
===================================================================
--- tokio.orig/src/fs/open_options.rs
+++ tokio/src/fs/open_options.rs
@@ -9,11 +9,11 @@ cfg_io_uring! {
use crate::runtime::driver::op::Op;
}
-#[cfg(test)]
+/*#[cfg(test)]
mod mock_open_options;
#[cfg(test)]
use mock_open_options::MockOpenOptions as StdOpenOptions;
-#[cfg(not(test))]
+#[cfg(not(test))]*/
use std::fs::OpenOptions as StdOpenOptions;
#[cfg(unix)]
Index: tokio/src/fs/read_dir.rs
===================================================================
--- tokio.orig/src/fs/read_dir.rs
+++ tokio/src/fs/read_dir.rs
@@ -10,13 +10,13 @@ use std::pin::Pin;
use std::sync::Arc;
use std::task::{ready, Context, Poll};
-#[cfg(test)]
+/*#[cfg(test)]
use super::mocks::spawn_blocking;
#[cfg(test)]
use super::mocks::JoinHandle;
-#[cfg(not(test))]
+#[cfg(not(test))]*/
use crate::blocking::spawn_blocking;
-#[cfg(not(test))]
+//#[cfg(not(test))]
use crate::blocking::JoinHandle;
const CHUNK_SIZE: usize = 32;
Index: tokio/src/fs/open_options/uring_open_options.rs
===================================================================
--- tokio.orig/src/fs/open_options/uring_open_options.rs
+++ tokio/src/fs/open_options/uring_open_options.rs
@@ -1,8 +1,8 @@
use std::{io, os::unix::fs::OpenOptionsExt};
-#[cfg(test)]
+/*#[cfg(test)]
use super::mock_open_options::MockOpenOptions as StdOpenOptions;
-#[cfg(not(test))]
+#[cfg(not(test))]*/
use std::fs::OpenOptions as StdOpenOptions;
#[derive(Debug, Clone)]
|