fix build on the latest nightly

This commit is contained in:
Waffle 2019-11-27 18:12:32 +03:00
parent c2d9001051
commit 7fea75f2d7
2 changed files with 8 additions and 7 deletions

View file

@ -1,4 +1,6 @@
use std::{convert::Infallible, future::Future, pin::Pin};
use std::{future::Future, pin::Pin};
#[cfg(not(feature = "never-type"))]
use std::convert::Infallible;
use async_trait::async_trait;
@ -82,23 +84,24 @@ where
pub struct IgnoreSafe;
#[cfg(feature = "never-type")]
#[allow(unreachable_code)]
#[async_trait]
impl ErrorPolicy<!> for IgnoreSafe {
async fn handle_error(&self, never: !)
async fn handle_error(&self, _: !)
where
!: 'async_trait,
{
never
}
}
#[cfg(not(feature = "never-type"))]
#[allow(unreachable_code)]
#[async_trait]
impl ErrorPolicy<Infallible> for IgnoreSafe {
async fn handle_error(&self, inf: Infallible)
async fn handle_error(&self, _: Infallible)
where
Infallible: 'async_trait,
{
match inf {}
}
}

View file

@ -1,5 +1,3 @@
#![cfg_attr(feature = "never-type", feature(never_type))]
#[macro_use]
extern crate derive_more;
#[macro_use]