@ -37,8 +37,12 @@ impl<T: BufRead + Unpin + ?Sized> Future for ReadLineFuture<'_, T> {
))
}))
} else {
debug_assert!(buf.is_empty());
debug_assert_eq!(*read, 0);
#[allow(clippy::debug_assert_with_mut_call)]
{
}
// Safety: `bytes` is a valid UTF-8 because `str::from_utf8` returned `Ok`.
mem::swap(unsafe { buf.as_mut_vec() }, bytes);
Poll::Ready(ret)
@ -37,7 +37,11 @@ impl<T: Read + Unpin + ?Sized> Future for ReadToStringFuture<'_, T> {
@ -15,7 +15,7 @@
//!
//! Consider the following code, operating on some global static variables:
//! ```rust
//! ```
//! static mut A: u32 = 0;
//! static mut B: u32 = 0;
//! static mut C: u32 = 0;
@ -175,6 +175,8 @@
//! # })
#![allow(clippy::needless_doctest_main)]
#[doc(inline)]
pub use std::sync::{Arc, Weak};
@ -89,6 +89,7 @@ where
static VTABLE: RawWakerVTable = {
unsafe fn clone_raw(ptr: *const ()) -> RawWaker {
let arc = ManuallyDrop::new(Arc::from_raw(ptr as *const Parker));
#[allow(clippy::redundant_clone)]
mem::forget(arc.clone());
RawWaker::new(ptr, &VTABLE)