Skip to content

Commit 7caa4ad

Browse files
authored
build: drop deprecated macos-system-configuration feature (#775)
* build: drop deprecated `macos-system-configuration` feature * remove unused test
1 parent b04e162 commit 7caa4ad

5 files changed

Lines changed: 6 additions & 278 deletions

File tree

Cargo.toml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,6 @@ webpki-roots = ["dep:webpki-root-certs"]
6060
# Use the system's proxy configuration.
6161
system-proxy = ["dep:system-configuration", "dep:windows-registry"]
6262

63-
# Deprecated, switch to system-proxy.
64-
macos-system-configuration = ["system-proxy"]
65-
6663
# Optional enable tracing
6764
tracing = ["http2/tracing", "dep:tracing"]
6865

@@ -163,12 +160,10 @@ hyper-util = { version = "0.1.13", features = [
163160
"server-graceful",
164161
"tokio",
165162
] }
166-
log = "0.4"
167163
serde = { version = "1.0", features = ["derive"] }
168164
flate2 = "1.1.1"
169165
zstd = "0.13"
170166
brotli = "8.0.0"
171-
doc-comment = "0.3"
172167
tokio = { version = "1.0", default-features = false, features = [
173168
"macros",
174169
"rt-multi-thread",

examples/connect_via_lower_priority_tokio_runtime.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717

1818
#[tokio::main]
1919
async fn main() -> wreq::Result<()> {
20+
tracing_subscriber::fmt()
21+
.with_max_level(tracing::Level::TRACE)
22+
.init();
2023
background_threadpool::init_background_runtime();
2124
tokio::time::sleep(std::time::Duration::from_millis(10)).await;
2225

@@ -83,7 +86,7 @@ mod background_threadpool {
8386
*libc::__errno_location() = 0;
8487
if libc::nice(10) == -1 && *libc::__errno_location() != 0 {
8588
let error = std::io::Error::last_os_error();
86-
log::error!("failed to set threadpool niceness: {error}");
89+
tracing::error!("failed to set threadpool niceness: {error}");
8790
}
8891
}
8992
}
@@ -92,7 +95,7 @@ mod background_threadpool {
9295
.build()
9396
.unwrap_or_else(|e| panic!("cpu heavy runtime failed_to_initialize: {e}"));
9497
rt.block_on(async {
95-
log::debug!("starting background cpu-heavy work");
98+
tracing::debug!("starting background cpu-heavy work");
9699
process_cpu_work().await;
97100
});
98101
})
@@ -122,7 +125,7 @@ mod background_threadpool {
122125
panic!("background cpu heavy runtime channel is closed")
123126
}
124127
Err(TrySendError::Full(msg)) => {
125-
log::warn!(
128+
tracing::warn!(
126129
"background cpu heavy runtime channel is full, task spawning loop delayed"
127130
);
128131
let tx = tx.clone();

src/core/client/conn/http2.rs

Lines changed: 0 additions & 233 deletions
Original file line numberDiff line numberDiff line change
@@ -254,236 +254,3 @@ where
254254
}
255255
}
256256
}
257-
258-
#[cfg(test)]
259-
mod tests {
260-
use http_body::Body;
261-
262-
use super::{Builder, Connection, SendRequest};
263-
use crate::core::{
264-
error::BoxError,
265-
rt::{Read, Write, bounds::Http2ClientConnExec},
266-
};
267-
268-
pub async fn handshake<E, T, B>(
269-
exec: E,
270-
io: T,
271-
) -> crate::core::Result<(SendRequest<B>, Connection<T, B, E>)>
272-
where
273-
T: Read + Write + Unpin,
274-
B: Body + 'static,
275-
B::Data: Send,
276-
B::Error: Into<BoxError>,
277-
E: Http2ClientConnExec<B, T> + Unpin + Clone,
278-
{
279-
Builder::new(exec).handshake(io).await
280-
}
281-
282-
#[tokio::test]
283-
#[ignore] // only compilation is checked
284-
async fn send_sync_executor_of_non_send_futures() {
285-
#[derive(Clone)]
286-
struct LocalTokioExecutor;
287-
288-
impl<F> crate::core::rt::Executor<F> for LocalTokioExecutor
289-
where
290-
F: std::future::Future + 'static, // not requiring `Send`
291-
{
292-
fn execute(&self, fut: F) {
293-
// This will spawn into the currently running `LocalSet`.
294-
tokio::task::spawn_local(fut);
295-
}
296-
}
297-
298-
#[allow(unused)]
299-
async fn run(io: impl crate::core::rt::Read + crate::core::rt::Write + Unpin + 'static) {
300-
let (_sender, conn) =
301-
handshake::<_, _, http_body_util::Empty<bytes::Bytes>>(LocalTokioExecutor, io)
302-
.await
303-
.unwrap();
304-
305-
tokio::task::spawn_local(async move {
306-
conn.await.unwrap();
307-
});
308-
}
309-
}
310-
311-
#[tokio::test]
312-
#[ignore] // only compilation is checked
313-
async fn not_send_not_sync_executor_of_not_send_futures() {
314-
#[derive(Clone)]
315-
struct LocalTokioExecutor {
316-
_x: std::marker::PhantomData<std::rc::Rc<()>>,
317-
}
318-
319-
impl<F> crate::core::rt::Executor<F> for LocalTokioExecutor
320-
where
321-
F: std::future::Future + 'static, // not requiring `Send`
322-
{
323-
fn execute(&self, fut: F) {
324-
// This will spawn into the currently running `LocalSet`.
325-
tokio::task::spawn_local(fut);
326-
}
327-
}
328-
329-
#[allow(unused)]
330-
async fn run(io: impl crate::core::rt::Read + crate::core::rt::Write + Unpin + 'static) {
331-
let (_sender, conn) = handshake::<_, _, http_body_util::Empty<bytes::Bytes>>(
332-
LocalTokioExecutor {
333-
_x: Default::default(),
334-
},
335-
io,
336-
)
337-
.await
338-
.unwrap();
339-
340-
tokio::task::spawn_local(async move {
341-
conn.await.unwrap();
342-
});
343-
}
344-
}
345-
346-
#[tokio::test]
347-
#[ignore] // only compilation is checked
348-
async fn send_not_sync_executor_of_not_send_futures() {
349-
#[derive(Clone)]
350-
struct LocalTokioExecutor {
351-
_x: std::marker::PhantomData<std::cell::Cell<()>>,
352-
}
353-
354-
impl<F> crate::core::rt::Executor<F> for LocalTokioExecutor
355-
where
356-
F: std::future::Future + 'static, // not requiring `Send`
357-
{
358-
fn execute(&self, fut: F) {
359-
// This will spawn into the currently running `LocalSet`.
360-
tokio::task::spawn_local(fut);
361-
}
362-
}
363-
364-
#[allow(unused)]
365-
async fn run(io: impl crate::core::rt::Read + crate::core::rt::Write + Unpin + 'static) {
366-
let (_sender, conn) = handshake::<_, _, http_body_util::Empty<bytes::Bytes>>(
367-
LocalTokioExecutor {
368-
_x: Default::default(),
369-
},
370-
io,
371-
)
372-
.await
373-
.unwrap();
374-
375-
tokio::task::spawn_local(async move {
376-
conn.await.unwrap();
377-
});
378-
}
379-
}
380-
381-
#[tokio::test]
382-
#[ignore] // only compilation is checked
383-
async fn send_sync_executor_of_send_futures() {
384-
#[derive(Clone)]
385-
struct TokioExecutor;
386-
387-
impl<F> crate::core::rt::Executor<F> for TokioExecutor
388-
where
389-
F: std::future::Future + 'static + Send,
390-
F::Output: Send + 'static,
391-
{
392-
fn execute(&self, fut: F) {
393-
tokio::task::spawn(fut);
394-
}
395-
}
396-
397-
#[allow(unused)]
398-
async fn run(
399-
io: impl crate::core::rt::Read + crate::core::rt::Write + Send + Unpin + 'static,
400-
) {
401-
let (_sender, conn) =
402-
handshake::<_, _, http_body_util::Empty<bytes::Bytes>>(TokioExecutor, io)
403-
.await
404-
.unwrap();
405-
406-
tokio::task::spawn(async move {
407-
conn.await.unwrap();
408-
});
409-
}
410-
}
411-
412-
#[tokio::test]
413-
#[ignore] // only compilation is checked
414-
async fn not_send_not_sync_executor_of_send_futures() {
415-
#[derive(Clone)]
416-
struct TokioExecutor {
417-
// !Send, !Sync
418-
_x: std::marker::PhantomData<std::rc::Rc<()>>,
419-
}
420-
421-
impl<F> crate::core::rt::Executor<F> for TokioExecutor
422-
where
423-
F: std::future::Future + 'static + Send,
424-
F::Output: Send + 'static,
425-
{
426-
fn execute(&self, fut: F) {
427-
tokio::task::spawn(fut);
428-
}
429-
}
430-
431-
#[allow(unused)]
432-
async fn run(
433-
io: impl crate::core::rt::Read + crate::core::rt::Write + Send + Unpin + 'static,
434-
) {
435-
let (_sender, conn) = handshake::<_, _, http_body_util::Empty<bytes::Bytes>>(
436-
TokioExecutor {
437-
_x: Default::default(),
438-
},
439-
io,
440-
)
441-
.await
442-
.unwrap();
443-
444-
tokio::task::spawn_local(async move {
445-
// can't use spawn here because when executor is !Send
446-
conn.await.unwrap();
447-
});
448-
}
449-
}
450-
451-
#[tokio::test]
452-
#[ignore] // only compilation is checked
453-
async fn send_not_sync_executor_of_send_futures() {
454-
#[derive(Clone)]
455-
struct TokioExecutor {
456-
// !Sync
457-
_x: std::marker::PhantomData<std::cell::Cell<()>>,
458-
}
459-
460-
impl<F> crate::core::rt::Executor<F> for TokioExecutor
461-
where
462-
F: std::future::Future + 'static + Send,
463-
F::Output: Send + 'static,
464-
{
465-
fn execute(&self, fut: F) {
466-
tokio::task::spawn(fut);
467-
}
468-
}
469-
470-
#[allow(unused)]
471-
async fn run(
472-
io: impl crate::core::rt::Read + crate::core::rt::Write + Send + Unpin + 'static,
473-
) {
474-
let (_sender, conn) = handshake::<_, _, http_body_util::Empty<bytes::Bytes>>(
475-
TokioExecutor {
476-
_x: Default::default(),
477-
},
478-
io,
479-
)
480-
.await
481-
.unwrap();
482-
483-
tokio::task::spawn_local(async move {
484-
// can't use spawn here because when executor is !Send
485-
conn.await.unwrap();
486-
});
487-
}
488-
}
489-
}

src/core/proto/h1/io.rs

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -625,40 +625,6 @@ mod tests {
625625
use super::*;
626626
use crate::core::common::io::Compat;
627627

628-
// #[cfg(feature = "nightly")]
629-
// use test::Bencher;
630-
631-
/*
632-
impl<T: Read> MemRead for AsyncIo<T> {
633-
fn read_mem(&mut self, len: usize) -> Poll<Bytes, io::Error> {
634-
let mut v = vec![0; len];
635-
let n = try_nb!(self.read(v.as_mut_slice()));
636-
Ok(Async::Ready(BytesMut::from(&v[..n]).freeze()))
637-
}
638-
}
639-
*/
640-
641-
#[tokio::test]
642-
#[ignore]
643-
async fn iobuf_write_empty_slice() {
644-
// TODO(eliza): can i have writev back pls T_T
645-
// // First, let's just check that the Mock would normally return an
646-
// // error on an unexpected write, even if the buffer is empty...
647-
// let mut mock = Mock::new().build();
648-
// std::future::poll_fn(|cx| {
649-
// Pin::new(&mut mock).poll_write_buf(cx, &mut Cursor::new(&[]))
650-
// })
651-
// .await
652-
// .expect_err("should be a broken pipe");
653-
654-
// // underlying io will return the logic error upon write,
655-
// // so we are testing that the io_buf does not trigger a write
656-
// // when there is nothing to flush
657-
// let mock = Mock::new().build();
658-
// let mut io_buf = Buffered::<_, Cursor<Vec<u8>>>::new(mock);
659-
// io_buf.flush().await.expect("should short-circuit flush");
660-
}
661-
662628
#[cfg(not(miri))]
663629
#[tokio::test]
664630
async fn parse_reads_until_blocked() {

src/lib.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -316,9 +316,6 @@ fn _assert_impls() {
316316
assert_sync::<Error>();
317317
}
318318

319-
#[cfg(test)]
320-
doc_comment::doctest!("../README.md");
321-
322319
#[cfg(feature = "multipart")]
323320
pub use self::client::multipart;
324321
#[cfg(feature = "websocket")]

0 commit comments

Comments
 (0)