2020-01-31 01:39:34 +01:00
|
|
|
// Regression test for #/1321
|
|
|
|
|
2020-03-12 04:52:21 +01:00
|
|
|
/*
|
2020-01-31 01:39:34 +01:00
|
|
|
use futures::task::{noop_waker, Context};
|
|
|
|
use futures::stream::once;
|
|
|
|
use actix_http::body::{MessageBody, BodyStream};
|
|
|
|
use bytes::Bytes;
|
|
|
|
|
2020-01-31 11:09:18 +01:00
|
|
|
Disable weird poll until actix-web is based on actix-http 2.0.0
|
|
|
|
|
2020-01-31 01:39:34 +01:00
|
|
|
#[test]
|
|
|
|
fn weird_poll() {
|
|
|
|
let (sender, receiver) = futures::channel::oneshot::channel();
|
|
|
|
let mut body_stream = Ok(BodyStream::new(once(async {
|
|
|
|
let x = Box::new(0);
|
|
|
|
let y = &x;
|
|
|
|
receiver.await.unwrap();
|
|
|
|
let _z = **y;
|
|
|
|
Ok::<_, ()>(Bytes::new())
|
|
|
|
})));
|
|
|
|
|
|
|
|
let waker = noop_waker();
|
|
|
|
let mut context = Context::from_waker(&waker);
|
|
|
|
|
|
|
|
let _ = body_stream.as_mut().unwrap().poll_next(&mut context);
|
|
|
|
sender.send(()).unwrap();
|
|
|
|
let _ = std::mem::replace(&mut body_stream, Err([0; 32])).unwrap().poll_next(&mut context);
|
|
|
|
}
|
|
|
|
|
2020-01-31 11:39:53 +01:00
|
|
|
*/
|