// The panic location should be in this file
assert_eq!(&panic_location_file.unwrap(), file!());
Ok(())
}
#[test] fn unsplit_panic_caller() -> Result<(), Box<dyn Error>> { let panic_location_file = test_panic(|| { let (r1, _w1) = split(RW); let (_r2, w2) = split(RW);
r1.unsplit(w2);
});
// The panic location should be in this file
assert_eq!(&panic_location_file.unwrap(), file!());
Ok(())
}
#[test] #[cfg(unix)] fn async_fd_new_panic_caller() -> Result<(), Box<dyn Error>> { use tokio::io::unix::AsyncFd; use tokio::runtime::Builder;
let panic_location_file = test_panic(|| { // Runtime without `enable_io` so it has no IO driver set. let rt = Builder::new_current_thread().build().unwrap();
rt.block_on(async { let fd = unix::MockFd;
let _ = AsyncFd::new(fd);
});
});
// The panic location should be in this file
assert_eq!(&panic_location_file.unwrap(), file!());
Ok(())
}
#[test] #[cfg(unix)] fn async_fd_with_interest_panic_caller() -> Result<(), Box<dyn Error>> { use tokio::io::unix::AsyncFd; use tokio::io::Interest; use tokio::runtime::Builder;
let panic_location_file = test_panic(|| { // Runtime without `enable_io` so it has no IO driver set. let rt = Builder::new_current_thread().build().unwrap();
rt.block_on(async { let fd = unix::MockFd;
let _ = AsyncFd::with_interest(fd, Interest::READABLE);
});
});
// The panic location should be in this file
assert_eq!(&panic_location_file.unwrap(), file!());
Ok(())
}
#[test] #[cfg(unix)] fn async_fd_try_new_panic_caller() -> Result<(), Box<dyn Error>> { use tokio::io::unix::AsyncFd; use tokio::runtime::Builder;
let panic_location_file = test_panic(|| { // Runtime without `enable_io` so it has no IO driver set. let rt = Builder::new_current_thread().build().unwrap();
rt.block_on(async { let fd = unix::MockFd;
let _ = AsyncFd::try_new(fd);
});
});
// The panic location should be in this file
assert_eq!(&panic_location_file.unwrap(), file!());
Ok(())
}
#[test] #[cfg(unix)] fn async_fd_try_with_interest_panic_caller() -> Result<(), Box<dyn Error>> { use tokio::io::unix::AsyncFd; use tokio::io::Interest; use tokio::runtime::Builder;
let panic_location_file = test_panic(|| { // Runtime without `enable_io` so it has no IO driver set. let rt = Builder::new_current_thread().build().unwrap();
rt.block_on(async { let fd = unix::MockFd;
let _ = AsyncFd::try_with_interest(fd, Interest::READABLE);
});
});
// The panic location should be in this file
assert_eq!(&panic_location_file.unwrap(), file!());
Ok(())
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.10 Sekunden
(vorverarbeitet am 2026-06-18)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.