We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tokio 0.2.4
AsyncBufReadExt::read_line panics at
AsyncBufReadExt::read_line
tokio/tokio/src/io/util/read_line.rs
Line 52 in 80abff0
Err
Full reproduction:
use std::pin::Pin; use std::task::{Context, Poll}; use tokio::io::{self, *}; struct MyStream { i: u32, } impl MyStream { fn new() -> Self { MyStream { i: 0 } } } impl AsyncRead for MyStream { fn poll_read( mut self: Pin<&mut Self>, _cx: &mut Context<'_>, buf: &mut [u8], ) -> Poll<io::Result<usize>> { match self.i { 0 => { buf[..5].copy_from_slice(b"hello"); self.i = 1; Poll::Ready(Ok(5)) } 1 => Poll::Ready(Err(io::ErrorKind::BrokenPipe.into())), _ => unreachable!(), } } } #[tokio::main] async fn main() -> io::Result<()> { let mut stream = BufReader::new(MyStream::new()); let mut line = String::new(); stream.read_line(&mut line).await?; Ok(()) }
The text was updated successfully, but these errors were encountered:
Looks like this was fixed by #2541.
Sorry, something went wrong.
No branches or pull requests
Version
tokio 0.2.4
Description
AsyncBufReadExt::read_line
panics attokio/tokio/src/io/util/read_line.rs
Line 52 in 80abff0
Err
in the middle of a line.Full reproduction:
The text was updated successfully, but these errors were encountered: