fix waker test. bump MSRV

This commit is contained in:
fakeshadow 2021-04-25 22:21:42 -07:00
parent 8abd8e66d6
commit fea17ca030
2 changed files with 6 additions and 4 deletions

View File

@ -18,7 +18,7 @@ jobs:
- { name: Windows (MinGW), os: windows-latest, triple: x86_64-pc-windows-gnu } - { name: Windows (MinGW), os: windows-latest, triple: x86_64-pc-windows-gnu }
- { name: Windows (32-bit), os: windows-latest, triple: i686-pc-windows-msvc } - { name: Windows (32-bit), os: windows-latest, triple: i686-pc-windows-msvc }
version: version:
- 1.46.0 # MSRV - 1.51.0 # MSRV
- stable - stable
- nightly - nightly

View File

@ -99,18 +99,20 @@ mod test {
#[test] #[test]
fn test_waker_channel() { fn test_waker_channel() {
let poll = mio::Poll::new().unwrap(); let mut poll = mio::Poll::new().unwrap();
let waker = from_registry(poll.registry()).unwrap(); let waker = from_registry(poll.registry()).unwrap();
let cx = &mut Context::from_waker(&waker); let cx = &mut Context::from_waker(&waker);
let (tx, mut rx) = waker_channel(); let (tx, mut rx) = waker_channel();
assert!(rx.poll_recv(cx).is_pending()); assert!(rx.poll_recv(cx).is_pending());
tx.wake(super::WakerInterest::Stop); tx.wake(super::WakerInterest::Stop);
let mut events = mio::Events::with_capacity(1);
poll.poll(&mut events, None).unwrap();
assert_eq!(events.iter().next().unwrap().token(), WAKER_TOKEN);
match rx.poll_recv(cx) { match rx.poll_recv(cx) {
Poll::Ready(Some(WakerInterest::Stop)) => {} Poll::Ready(Some(WakerInterest::Stop)) => {}
_ => panic!("Failed to wake up WakerRx"), _ => panic!("Failed to wake up WakerRx"),