ci: test more things with miri (#6885)

This commit is contained in:
tiif 2024-10-11 15:44:50 +08:00 committed by GitHub
parent 9cc4a81678
commit 161b8c80d5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
66 changed files with 83 additions and 34 deletions

View File

@ -17,6 +17,8 @@ env:
# Change to specific Rust release to pin # Change to specific Rust release to pin
rust_stable: stable rust_stable: stable
rust_nightly: nightly-2024-05-05 rust_nightly: nightly-2024-05-05
# Pin a specific miri version
rust_miri_nightly: nightly-2024-09-19
rust_clippy: '1.77' rust_clippy: '1.77'
# When updating this, also update: # When updating this, also update:
# - README.md # - README.md
@ -413,17 +415,19 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Install Rust ${{ env.rust_nightly }} - name: Install Rust ${{ env.rust_miri_nightly }}
uses: dtolnay/rust-toolchain@stable uses: dtolnay/rust-toolchain@stable
with: with:
toolchain: ${{ env.rust_nightly }} toolchain: ${{ env.rust_miri_nightly }}
components: miri components: miri
- name: Install cargo-nextest
uses: taiki-e/install-action@v2
with:
tool: cargo-nextest
- uses: Swatinem/rust-cache@v2 - uses: Swatinem/rust-cache@v2
- name: miri - name: miri
# Many of tests in tokio/tests and doctests use #[tokio::test] or
# #[tokio::main] that calls epoll_create1 that Miri does not support.
run: | run: |
cargo miri test --features full --lib --no-fail-fast cargo miri nextest run --features full --lib --tests --no-fail-fast
working-directory: tokio working-directory: tokio
env: env:
MIRIFLAGS: -Zmiri-disable-isolation -Zmiri-strict-provenance -Zmiri-retag-fields MIRIFLAGS: -Zmiri-disable-isolation -Zmiri-strict-provenance -Zmiri-retag-fields

View File

@ -1,4 +1,5 @@
#[test] #[test]
#[cfg_attr(miri, ignore)]
fn compile_fail_full() { fn compile_fail_full() {
let t = trybuild::TestCases::new(); let t = trybuild::TestCases::new();

View File

@ -1,5 +1,5 @@
#![warn(rust_2018_idioms)] #![warn(rust_2018_idioms)]
#![cfg(all(feature = "full", not(target_os = "wasi")))] #![cfg(all(feature = "full", not(target_os = "wasi"), not(miri)))]
use tokio::io::{AsyncBufReadExt, AsyncReadExt, AsyncWriteExt, BufReader}; use tokio::io::{AsyncBufReadExt, AsyncReadExt, AsyncWriteExt, BufReader};
use tokio::join; use tokio::join;

View File

@ -1,5 +1,7 @@
#![warn(rust_2018_idioms)] #![warn(rust_2018_idioms)]
#![cfg(not(target_os = "wasi"))] // Wasi doesn't support threads #![cfg(not(target_os = "wasi"))] // Wasi doesn't support threads
// Blocked on https://github.com/rust-lang/miri/issues/3911
#![cfg(not(miri))]
use std::rc::Rc; use std::rc::Rc;
use std::sync::Arc; use std::sync::Arc;

View File

@ -92,6 +92,7 @@ async fn single_short_delay() {
} }
#[tokio::test] #[tokio::test]
#[cfg_attr(miri, ignore)] // Too slow on miri.
async fn multi_delay_at_start() { async fn multi_delay_at_start() {
time::pause(); time::pause();

View File

@ -1,5 +1,6 @@
#![warn(rust_2018_idioms)] #![warn(rust_2018_idioms)]
#![cfg(not(target_os = "wasi"))] // Wasi doesn't support UDP #![cfg(not(target_os = "wasi"))] // Wasi doesn't support UDP
#![cfg(not(miri))] // No `socket` in Miri.
use tokio::net::UdpSocket; use tokio::net::UdpSocket;
use tokio_stream::StreamExt; use tokio_stream::StreamExt;

View File

@ -9,6 +9,7 @@ use std::net::TcpStream;
use std::thread; use std::thread;
#[tokio::test] #[tokio::test]
#[cfg_attr(miri, ignore)]
async fn echo_server() { async fn echo_server() {
const N: usize = 1024; const N: usize = 1024;

View File

@ -22,6 +22,7 @@ use tokio::net::UdpSocket;
/// Since we are both sending and receiving, that should happen once per 64 packets, because budgets are of size 128 /// Since we are both sending and receiving, that should happen once per 64 packets, because budgets are of size 128
/// and there are two budget events per packet, a send and a recv. /// and there are two budget events per packet, a send and a recv.
#[tokio::test] #[tokio::test]
#[cfg_attr(miri, ignore)]
async fn coop_budget_udp_send_recv() { async fn coop_budget_udp_send_recv() {
const BUDGET: usize = 128; const BUDGET: usize = 128;
const N_ITERATIONS: usize = 1024; const N_ITERATIONS: usize = 1024;

View File

@ -5,6 +5,7 @@ use tempfile::tempdir;
use tokio::fs; use tokio::fs;
#[tokio::test] #[tokio::test]
#[cfg_attr(miri, ignore)]
async fn copy() { async fn copy() {
let dir = tempdir().unwrap(); let dir = tempdir().unwrap();
@ -21,6 +22,7 @@ async fn copy() {
} }
#[tokio::test] #[tokio::test]
#[cfg_attr(miri, ignore)]
async fn copy_permissions() { async fn copy_permissions() {
let dir = tempdir().unwrap(); let dir = tempdir().unwrap();
let from_path = dir.path().join("foo.txt"); let from_path = dir.path().join("foo.txt");

View File

@ -203,6 +203,7 @@ async fn set_max_buf_size_write() {
} }
#[tokio::test] #[tokio::test]
#[cfg_attr(miri, ignore)]
#[cfg(unix)] #[cfg(unix)]
async fn file_debug_fmt() { async fn file_debug_fmt() {
let tempfile = tempfile(); let tempfile = tempfile();

View File

@ -7,6 +7,7 @@ use std::io::Write;
use tempfile::tempdir; use tempfile::tempdir;
#[tokio::test] #[tokio::test]
#[cfg_attr(miri, ignore)]
async fn test_hard_link() { async fn test_hard_link() {
let dir = tempdir().unwrap(); let dir = tempdir().unwrap();
let src = dir.path().join("src.txt"); let src = dir.path().join("src.txt");

View File

@ -5,6 +5,7 @@ use tempfile::tempdir;
use tokio::fs; use tokio::fs;
#[tokio::test] #[tokio::test]
#[cfg_attr(miri, ignore)]
async fn try_exists() { async fn try_exists() {
let dir = tempdir().unwrap(); let dir = tempdir().unwrap();

View File

@ -1,5 +1,5 @@
#![warn(rust_2018_idioms)] #![warn(rust_2018_idioms)]
#![cfg(all(unix, feature = "full"))] #![cfg(all(unix, feature = "full", not(miri)))]
use std::os::unix::io::{AsRawFd, RawFd}; use std::os::unix::io::{AsRawFd, RawFd};
use std::sync::{ use std::sync::{
@ -655,6 +655,7 @@ fn send_oob_data<S: AsRawFd>(stream: &S, data: &[u8]) -> io::Result<usize> {
} }
#[tokio::test] #[tokio::test]
#[cfg_attr(miri, ignore)]
async fn clear_ready_matching_clears_ready() { async fn clear_ready_matching_clears_ready() {
use tokio::io::{Interest, Ready}; use tokio::io::{Interest, Ready};
@ -678,6 +679,7 @@ async fn clear_ready_matching_clears_ready() {
} }
#[tokio::test] #[tokio::test]
#[cfg_attr(miri, ignore)]
async fn clear_ready_matching_clears_ready_mut() { async fn clear_ready_matching_clears_ready_mut() {
use tokio::io::{Interest, Ready}; use tokio::io::{Interest, Ready};
@ -702,6 +704,7 @@ async fn clear_ready_matching_clears_ready_mut() {
#[tokio::test] #[tokio::test]
#[cfg(target_os = "linux")] #[cfg(target_os = "linux")]
#[cfg_attr(miri, ignore)]
async fn await_error_readiness_timestamping() { async fn await_error_readiness_timestamping() {
use std::net::{Ipv4Addr, SocketAddr}; use std::net::{Ipv4Addr, SocketAddr};
@ -758,6 +761,7 @@ fn configure_timestamping_socket(udp_socket: &std::net::UdpSocket) -> std::io::R
#[tokio::test] #[tokio::test]
#[cfg(target_os = "linux")] #[cfg(target_os = "linux")]
#[cfg_attr(miri, ignore)]
async fn await_error_readiness_invalid_address() { async fn await_error_readiness_invalid_address() {
use std::net::{Ipv4Addr, SocketAddr}; use std::net::{Ipv4Addr, SocketAddr};
use tokio::io::{Interest, Ready}; use tokio::io::{Interest, Ready};

View File

@ -1,5 +1,5 @@
#![warn(rust_2018_idioms)] #![warn(rust_2018_idioms)]
#![cfg(all(feature = "full", not(target_os = "wasi")))] // Wasi does not support bind() #![cfg(all(feature = "full", not(target_os = "wasi"), not(miri)))] // Wasi does not support bind()
use std::time::Duration; use std::time::Duration;
use tokio::io::{self, copy_bidirectional, AsyncReadExt, AsyncWriteExt}; use tokio::io::{self, copy_bidirectional, AsyncReadExt, AsyncWriteExt};

View File

@ -1,6 +1,6 @@
#![warn(rust_2018_idioms)] #![warn(rust_2018_idioms)]
// Wasi does not support panic recovery or threading // Wasi does not support panic recovery or threading
#![cfg(all(feature = "full", not(target_os = "wasi")))] #![cfg(all(feature = "full", not(target_os = "wasi"), not(miri)))]
use tokio::net::TcpListener; use tokio::net::TcpListener;
use tokio::runtime; use tokio::runtime;

View File

@ -1,5 +1,5 @@
#![warn(rust_2018_idioms)] #![warn(rust_2018_idioms)]
#![cfg(all(feature = "full", not(target_os = "wasi")))] // Wasi does not support bind #![cfg(all(feature = "full", not(target_os = "wasi"), not(miri)))] // Wasi does not support bind
use tokio::net::TcpListener; use tokio::net::TcpListener;
use tokio::runtime; use tokio::runtime;

View File

@ -79,6 +79,7 @@ async fn read_to_end_uninit() {
} }
#[tokio::test] #[tokio::test]
#[cfg_attr(miri, ignore)] // too slow with miri
async fn read_to_end_doesnt_grow_with_capacity() { async fn read_to_end_doesnt_grow_with_capacity() {
let arr: Vec<u8> = (0..100).collect(); let arr: Vec<u8> = (0..100).collect();

View File

@ -1,5 +1,5 @@
#![warn(rust_2018_idioms)] #![warn(rust_2018_idioms)]
#![cfg(feature = "full")] #![cfg(all(feature = "full", not(miri)))]
use tokio::io::AsyncReadExt; use tokio::io::AsyncReadExt;

View File

@ -1,5 +1,5 @@
#![warn(rust_2018_idioms)] #![warn(rust_2018_idioms)]
#![cfg(all(feature = "full", not(target_os = "wasi")))] // Wasi doesn't support panic recovery or bind #![cfg(all(feature = "full", not(target_os = "wasi"), not(miri)))] // Wasi doesn't support panic recovery or bind
use tokio::net::TcpListener; use tokio::net::TcpListener;

View File

@ -23,6 +23,7 @@ async fn lookup_str_socket_addr() {
} }
#[tokio::test] #[tokio::test]
#[cfg_attr(miri, ignore)]
async fn resolve_dns() -> io::Result<()> { async fn resolve_dns() -> io::Result<()> {
let mut hosts = net::lookup_host("localhost:3000").await?; let mut hosts = net::lookup_host("localhost:3000").await?;
let host = hosts.next().unwrap(); let host = hosts.next().unwrap();

View File

@ -1,5 +1,5 @@
#![warn(rust_2018_idioms)] #![warn(rust_2018_idioms)]
#![cfg(all(feature = "full", not(target_os = "wasi")))] #![cfg(all(feature = "full", not(target_os = "wasi"), not(miri)))]
#![cfg(panic = "unwind")] #![cfg(panic = "unwind")]
use std::error::Error; use std::error::Error;

View File

@ -1,5 +1,6 @@
#![cfg(feature = "full")] #![cfg(feature = "full")]
#![cfg(unix)] #![cfg(unix)]
#![cfg(not(miri))]
use tokio::io::{AsyncReadExt, AsyncWriteExt, Interest}; use tokio::io::{AsyncReadExt, AsyncWriteExt, Interest};
use tokio::net::unix::pipe; use tokio::net::unix::pipe;

View File

@ -1,4 +1,4 @@
#![cfg(all(feature = "full", not(target_os = "wasi")))] // Wasi does not support panic recovery #![cfg(all(feature = "full", not(target_os = "wasi"), not(miri)))] // Wasi does not support panic recovery
use tokio::net::TcpStream; use tokio::net::TcpStream;
use tokio::sync::oneshot; use tokio::sync::oneshot;

View File

@ -1,5 +1,5 @@
#![warn(rust_2018_idioms)] #![warn(rust_2018_idioms)]
#![cfg(all(feature = "full", unix))] #![cfg(all(feature = "full", unix, not(miri)))]
use tokio::process::Command; use tokio::process::Command;

View File

@ -3,7 +3,7 @@
// This tests test the behavior of `process::Command::spawn` when it is used // This tests test the behavior of `process::Command::spawn` when it is used
// outside runtime, and when `process::Child::wait ` is used in a different // outside runtime, and when `process::Child::wait ` is used in a different
// runtime from which `process::Command::spawn` is used. // runtime from which `process::Command::spawn` is used.
#![cfg(all(unix, not(target_os = "freebsd")))] #![cfg(all(unix, not(target_os = "freebsd"), not(miri)))]
use std::process::Stdio; use std::process::Stdio;
use tokio::{process::Command, runtime::Runtime}; use tokio::{process::Command, runtime::Runtime};

View File

@ -7,7 +7,7 @@
// It is expected that `EVFILT_WRITE` would be returned with either the // It is expected that `EVFILT_WRITE` would be returned with either the
// `EV_EOF` or `EV_ERROR` flag set. If either flag is set a write would be // `EV_EOF` or `EV_ERROR` flag set. If either flag is set a write would be
// attempted, but that does not seem to occur. // attempted, but that does not seem to occur.
#![cfg(all(unix, not(target_os = "freebsd")))] #![cfg(all(unix, not(target_os = "freebsd"), not(miri)))]
use std::process::Stdio; use std::process::Stdio;
use std::time::Duration; use std::time::Duration;

View File

@ -1,6 +1,7 @@
#![warn(rust_2018_idioms)] #![warn(rust_2018_idioms)]
#![cfg(feature = "full")] #![cfg(feature = "full")]
#![cfg(unix)] #![cfg(unix)]
#![cfg(not(miri))]
use futures::future::join_all; use futures::future::join_all;
use std::process::Stdio; use std::process::Stdio;

View File

@ -1,4 +1,4 @@
#![cfg(all(unix, feature = "process"))] #![cfg(all(unix, feature = "process", not(miri)))]
#![warn(rust_2018_idioms)] #![warn(rust_2018_idioms)]
use std::io::ErrorKind; use std::io::ErrorKind;

View File

@ -1,6 +1,7 @@
#![warn(rust_2018_idioms)] #![warn(rust_2018_idioms)]
#![cfg(feature = "full")] #![cfg(feature = "full")]
#![cfg(windows)] #![cfg(windows)]
#![cfg(not(miri))]
use tokio::process::Command; use tokio::process::Command;
use windows_sys::Win32::System::Threading::GetProcessId; use windows_sys::Win32::System::Threading::GetProcessId;

View File

@ -1,5 +1,5 @@
#![warn(rust_2018_idioms)] #![warn(rust_2018_idioms)]
#![cfg(all(feature = "full", not(target_os = "wasi")))] // Wasi cannot run system commands #![cfg(all(feature = "full", not(target_os = "wasi"), not(miri)))] // Wasi cannot run system commands
use tokio::process::Command; use tokio::process::Command;
use tokio_test::assert_ok; use tokio_test::assert_ok;

View File

@ -1,6 +1,7 @@
#![allow(unknown_lints, unexpected_cfgs)] #![allow(unknown_lints, unexpected_cfgs)]
#![warn(rust_2018_idioms)] #![warn(rust_2018_idioms)]
#![cfg(feature = "full")] #![cfg(feature = "full")]
#![cfg(not(miri))] // Possible bug on Miri.
use tokio::runtime::Runtime; use tokio::runtime::Runtime;
use tokio::sync::oneshot; use tokio::sync::oneshot;

View File

@ -2,6 +2,7 @@
#![allow(clippy::needless_range_loop)] #![allow(clippy::needless_range_loop)]
#![warn(rust_2018_idioms)] #![warn(rust_2018_idioms)]
#![cfg(feature = "full")] #![cfg(feature = "full")]
#![cfg(not(miri))]
// Tests to run on both current-thread & multi-thread runtime variants. // Tests to run on both current-thread & multi-thread runtime variants.

View File

@ -1,5 +1,5 @@
#![warn(rust_2018_idioms)] #![warn(rust_2018_idioms)]
#![cfg(feature = "full")] #![cfg(all(feature = "full", not(miri)))]
// All io tests that deal with shutdown is currently ignored because there are known bugs in with // All io tests that deal with shutdown is currently ignored because there are known bugs in with
// shutting down the io driver while concurrently registering new resources. See // shutting down the io driver while concurrently registering new resources. See

View File

@ -1,6 +1,7 @@
#![allow(unknown_lints, unexpected_cfgs)] #![allow(unknown_lints, unexpected_cfgs)]
#![warn(rust_2018_idioms)] #![warn(rust_2018_idioms)]
#![cfg(all(feature = "full", not(target_os = "wasi")))] // Too slow on miri.
#![cfg(all(feature = "full", not(target_os = "wasi"), not(miri)))]
use tokio::io::{AsyncReadExt, AsyncWriteExt}; use tokio::io::{AsyncReadExt, AsyncWriteExt};
use tokio::net::{TcpListener, TcpStream}; use tokio::net::{TcpListener, TcpStream};
@ -321,6 +322,8 @@ fn start_stop_callbacks_called() {
} }
#[test] #[test]
// too slow on miri
#[cfg_attr(miri, ignore)]
fn blocking() { fn blocking() {
// used for notifying the main thread // used for notifying the main thread
const NUM: usize = 1_000; const NUM: usize = 1_000;

View File

@ -1,6 +1,7 @@
#![warn(rust_2018_idioms)] #![warn(rust_2018_idioms)]
#![cfg(feature = "full")] #![cfg(feature = "full")]
#![cfg(unix)] #![cfg(unix)]
#![cfg(not(miri))] // No `sigaction` on Miri
mod support { mod support {
pub mod signal; pub mod signal;

View File

@ -1,6 +1,7 @@
#![warn(rust_2018_idioms)] #![warn(rust_2018_idioms)]
#![cfg(feature = "full")] #![cfg(feature = "full")]
#![cfg(unix)] #![cfg(unix)]
#![cfg(not(miri))]
mod support { mod support {
pub mod signal; pub mod signal;

View File

@ -1,6 +1,7 @@
#![warn(rust_2018_idioms)] #![warn(rust_2018_idioms)]
#![cfg(feature = "full")] #![cfg(feature = "full")]
#![cfg(unix)] #![cfg(unix)]
#![cfg(not(miri))]
mod support { mod support {
pub mod signal; pub mod signal;

View File

@ -1,6 +1,7 @@
#![warn(rust_2018_idioms)] #![warn(rust_2018_idioms)]
#![cfg(feature = "full")] #![cfg(feature = "full")]
#![cfg(unix)] #![cfg(unix)]
#![cfg(not(miri))]
mod support { mod support {
pub mod signal; pub mod signal;

View File

@ -1,6 +1,7 @@
#![warn(rust_2018_idioms)] #![warn(rust_2018_idioms)]
#![cfg(feature = "full")] #![cfg(feature = "full")]
#![cfg(unix)] #![cfg(unix)]
#![cfg(not(miri))] // No `sigaction` on Miri.
mod support { mod support {
pub mod signal; pub mod signal;

View File

@ -1,6 +1,7 @@
#![warn(rust_2018_idioms)] #![warn(rust_2018_idioms)]
#![cfg(feature = "full")] #![cfg(feature = "full")]
#![cfg(unix)] #![cfg(unix)]
#![cfg(not(miri))] // No `sigaction` on Miri.
use tokio::signal::unix::{signal, SignalKind}; use tokio::signal::unix::{signal, SignalKind};

View File

@ -1,6 +1,7 @@
#![warn(rust_2018_idioms)] #![warn(rust_2018_idioms)]
#![cfg(feature = "full")] #![cfg(feature = "full")]
#![cfg(unix)] #![cfg(unix)]
#![cfg(not(miri))] // No `sigaction` on Miri.
mod support { mod support {
pub mod signal; pub mod signal;

View File

@ -2,6 +2,7 @@
#![cfg(feature = "full")] #![cfg(feature = "full")]
#![cfg(unix)] #![cfg(unix)]
#![cfg(panic = "unwind")] #![cfg(panic = "unwind")]
#![cfg(not(miri))] // No `sigaction` on Miri.
use std::error::Error; use std::error::Error;
use tokio::runtime::Builder; use tokio::runtime::Builder;

View File

@ -1,6 +1,7 @@
#![warn(rust_2018_idioms)] #![warn(rust_2018_idioms)]
#![cfg(feature = "full")] #![cfg(feature = "full")]
#![cfg(unix)] #![cfg(unix)]
#![cfg(not(miri))] // No `sigaction` on Miri.
mod support { mod support {
pub mod signal; pub mod signal;

View File

@ -1,6 +1,7 @@
#![warn(rust_2018_idioms)] #![warn(rust_2018_idioms)]
#![cfg(feature = "full")] #![cfg(feature = "full")]
#![cfg(unix)] #![cfg(unix)]
#![cfg(not(miri))] // No `sigaction` in Miri.
mod support { mod support {
pub mod signal; pub mod signal;

View File

@ -680,6 +680,7 @@ async fn try_reserve_many_on_closed_channel() {
} }
#[maybe_tokio_test] #[maybe_tokio_test]
#[cfg_attr(miri, ignore)] // Too slow on miri.
async fn try_reserve_many_full() { async fn try_reserve_many_full() {
// Reserve n capacity and send k messages // Reserve n capacity and send k messages
for n in 1..100 { for n in 1..100 {

View File

@ -59,6 +59,7 @@ fn readiness() {
/// is aborted prematurely. /// is aborted prematurely.
#[tokio::test] #[tokio::test]
#[cfg(feature = "full")] #[cfg(feature = "full")]
#[cfg_attr(miri, ignore)]
async fn aborted_future_1() { async fn aborted_future_1() {
use std::time::Duration; use std::time::Duration;
use tokio::time::{interval, timeout}; use tokio::time::{interval, timeout};

View File

@ -173,6 +173,7 @@ async fn write_order() {
// A single RwLock is contested by tasks in multiple threads // A single RwLock is contested by tasks in multiple threads
#[cfg(all(feature = "full", not(target_os = "wasi")))] // Wasi doesn't support threads #[cfg(all(feature = "full", not(target_os = "wasi")))] // Wasi doesn't support threads
#[cfg_attr(miri, ignore)] // Too slow on miri.
#[tokio::test(flavor = "multi_thread", worker_threads = 8)] #[tokio::test(flavor = "multi_thread", worker_threads = 8)]
async fn multithreaded() { async fn multithreaded() {
use futures::stream::{self, StreamExt}; use futures::stream::{self, StreamExt};

View File

@ -1,5 +1,5 @@
#![warn(rust_2018_idioms)] #![warn(rust_2018_idioms)]
#![cfg(all(feature = "full", not(target_os = "wasi")))] // Wasi doesn't support threads #![cfg(all(feature = "full", not(target_os = "wasi"), not(miri)))] // Wasi doesn't support threads
use tokio::{runtime, task, time}; use tokio::{runtime, task, time};
use tokio_test::assert_ok; use tokio_test::assert_ok;

View File

@ -1,5 +1,5 @@
#![warn(rust_2018_idioms)] #![warn(rust_2018_idioms)]
#![cfg(all(feature = "full", not(target_os = "wasi")))] // Wasi doesn't support bind #![cfg(all(feature = "full", not(target_os = "wasi"), not(miri)))] // Wasi doesn't support bind
use tokio::net::{TcpListener, TcpStream}; use tokio::net::{TcpListener, TcpStream};
use tokio::sync::{mpsc, oneshot}; use tokio::sync::{mpsc, oneshot};

View File

@ -1,5 +1,5 @@
#![warn(rust_2018_idioms)] #![warn(rust_2018_idioms)]
#![cfg(all(feature = "full", not(target_os = "wasi")))] // Wasi doesn't support bind #![cfg(all(feature = "full", not(target_os = "wasi"), not(miri)))] // Wasi doesn't support bind
use tokio::net::{TcpListener, TcpStream}; use tokio::net::{TcpListener, TcpStream};
use tokio::sync::oneshot; use tokio::sync::oneshot;

View File

@ -1,5 +1,5 @@
#![warn(rust_2018_idioms)] #![warn(rust_2018_idioms)]
#![cfg(all(feature = "full", not(target_os = "wasi")))] // Wasi doesn't support bind #![cfg(all(feature = "full", not(target_os = "wasi"), not(miri)))] // Wasi doesn't support bind
use tokio::io::{self, AsyncReadExt, AsyncWriteExt}; use tokio::io::{self, AsyncReadExt, AsyncWriteExt};
use tokio::net::{TcpListener, TcpStream}; use tokio::net::{TcpListener, TcpStream};

View File

@ -1,5 +1,5 @@
#![warn(rust_2018_idioms)] #![warn(rust_2018_idioms)]
#![cfg(all(feature = "full", not(target_os = "wasi")))] // Wasi doesn't support bind #![cfg(all(feature = "full", not(target_os = "wasi"), not(miri)))] // Wasi doesn't support bind
use std::io::{Error, ErrorKind, Result}; use std::io::{Error, ErrorKind, Result};
use std::io::{Read, Write}; use std::io::{Read, Write};

View File

@ -1,5 +1,5 @@
#![warn(rust_2018_idioms)] #![warn(rust_2018_idioms)]
#![cfg(all(feature = "full", not(target_os = "wasi")))] // Wasi doesn't support bind #![cfg(all(feature = "full", not(target_os = "wasi"), not(miri)))] // Wasi doesn't support bind
use std::io::Read; use std::io::Read;
use std::io::Result; use std::io::Result;

View File

@ -1,5 +1,5 @@
#![warn(rust_2018_idioms)] #![warn(rust_2018_idioms)]
#![cfg(all(feature = "full", not(target_os = "wasi")))] // Wasi doesn't support bind #![cfg(all(feature = "full", not(target_os = "wasi"), not(miri)))] // Wasi doesn't support bind
use tokio::io::AsyncReadExt; use tokio::io::AsyncReadExt;
use tokio::net::TcpStream; use tokio::net::TcpStream;

View File

@ -1,5 +1,5 @@
#![warn(rust_2018_idioms)] #![warn(rust_2018_idioms)]
#![cfg(all(feature = "full", not(target_os = "wasi")))] // Wasi doesn't support bind #![cfg(all(feature = "full", not(target_os = "wasi"), not(miri)))] // Wasi doesn't support bind
use tokio::io::{self, AsyncReadExt, AsyncWriteExt}; use tokio::io::{self, AsyncReadExt, AsyncWriteExt};
use tokio::net::{TcpListener, TcpStream}; use tokio::net::{TcpListener, TcpStream};

View File

@ -1,5 +1,5 @@
#![warn(rust_2018_idioms)] #![warn(rust_2018_idioms)]
#![cfg(all(feature = "full", not(target_os = "wasi")))] // Wasi doesn't support bind #![cfg(all(feature = "full", not(target_os = "wasi"), not(miri)))] // Wasi doesn't support bind
use std::time::Duration; use std::time::Duration;
use tokio::net::TcpSocket; use tokio::net::TcpSocket;

View File

@ -1,5 +1,5 @@
#![warn(rust_2018_idioms)] #![warn(rust_2018_idioms)]
#![cfg(all(feature = "full", not(target_os = "wasi")))] // Wasi doesn't support bind #![cfg(all(feature = "full", not(target_os = "wasi"), not(miri)))] // Wasi doesn't support bind
use std::io::Result; use std::io::Result;
use std::io::{Read, Write}; use std::io::{Read, Write};

View File

@ -1,5 +1,5 @@
#![warn(rust_2018_idioms)] #![warn(rust_2018_idioms)]
#![cfg(all(feature = "full", not(target_os = "wasi")))] // Wasi doesn't support bind #![cfg(all(feature = "full", not(target_os = "wasi"), not(miri)))] // Wasi doesn't support bind
use tokio::io::{AsyncReadExt, AsyncWriteExt, Interest}; use tokio::io::{AsyncReadExt, AsyncWriteExt, Interest};
use tokio::net::{TcpListener, TcpStream}; use tokio::net::{TcpListener, TcpStream};

View File

@ -1,5 +1,6 @@
#![warn(rust_2018_idioms)] #![warn(rust_2018_idioms)]
#![cfg(feature = "full")] #![cfg(feature = "full")]
#![cfg(not(miri))] // Too slow on miri.
use rand::SeedableRng; use rand::SeedableRng;
use rand::{rngs::StdRng, Rng}; use rand::{rngs::StdRng, Rng};

View File

@ -1,5 +1,6 @@
#![warn(rust_2018_idioms)] #![warn(rust_2018_idioms)]
#![cfg(feature = "full")] #![cfg(feature = "full")]
#![cfg(not(miri))] // Too slow on Miri.
use std::future::Future; use std::future::Future;
use std::task::Context; use std::task::Context;

View File

@ -1,5 +1,5 @@
#![warn(rust_2018_idioms)] #![warn(rust_2018_idioms)]
#![cfg(all(feature = "full", not(target_os = "wasi")))] // Wasi does not support bind or UDP #![cfg(all(feature = "full", not(target_os = "wasi"), not(miri)))] // Wasi does not support bind or UDP
use std::future::poll_fn; use std::future::poll_fn;
use std::io; use std::io;

View File

@ -1,6 +1,6 @@
#![warn(rust_2018_idioms)] #![warn(rust_2018_idioms)]
#![cfg(feature = "full")] #![cfg(feature = "full")]
#![cfg(all(unix, not(target_os = "dragonfly")))] #![cfg(all(unix, not(target_os = "dragonfly"), not(miri)))]
use tokio::net::UnixStream; use tokio::net::UnixStream;

View File

@ -1,6 +1,7 @@
#![warn(rust_2018_idioms)] #![warn(rust_2018_idioms)]
#![cfg(feature = "full")] #![cfg(feature = "full")]
#![cfg(unix)] #![cfg(unix)]
#![cfg(not(miri))]
use tokio::io::ReadBuf; use tokio::io::ReadBuf;
use tokio::net::UnixDatagram; use tokio::net::UnixDatagram;

View File

@ -1,6 +1,7 @@
#![warn(rust_2018_idioms)] #![warn(rust_2018_idioms)]
#![cfg(feature = "full")] #![cfg(feature = "full")]
#![cfg(unix)] #![cfg(unix)]
#![cfg(not(miri))]
use futures::future::try_join; use futures::future::try_join;
use std::io; use std::io;

View File

@ -1,6 +1,7 @@
#![warn(rust_2018_idioms)] #![warn(rust_2018_idioms)]
#![cfg(feature = "full")] #![cfg(feature = "full")]
#![cfg(unix)] #![cfg(unix)]
#![cfg(not(miri))]
use tokio::io::{AsyncRead, AsyncReadExt, AsyncWrite, AsyncWriteExt}; use tokio::io::{AsyncRead, AsyncReadExt, AsyncWrite, AsyncWriteExt};
use tokio::net::UnixStream; use tokio::net::UnixStream;

View File

@ -1,6 +1,7 @@
#![cfg(feature = "full")] #![cfg(feature = "full")]
#![warn(rust_2018_idioms)] #![warn(rust_2018_idioms)]
#![cfg(unix)] #![cfg(unix)]
#![cfg(not(miri))]
use std::io; use std::io;
#[cfg(target_os = "android")] #[cfg(target_os = "android")]