From efb5b3ee5b758b71415611915601acc534f00e2d Mon Sep 17 00:00:00 2001 From: 4lDO2 <4lDO2@protonmail.com> Date: Sat, 12 Mar 2022 10:36:07 +0100 Subject: [PATCH] Replace ! with Infallible for now. --- src/daemon.rs | 6 +++++- src/lib.rs | 1 - 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/daemon.rs b/src/daemon.rs index 11a97ca..6433bcd 100644 --- a/src/daemon.rs +++ b/src/daemon.rs @@ -1,3 +1,5 @@ +use core::convert::Infallible; + use super::{ clone, CloneFlags, @@ -17,7 +19,7 @@ pub struct Daemon { } impl Daemon { - pub fn new !>(f: F) -> Result { + pub fn new Infallible>(f: F) -> Result { let mut pipes = [0; 2]; pipe2(&mut pipes, 0)?; @@ -29,6 +31,8 @@ impl Daemon { f(Daemon { write_pipe, }); + // TODO: Replace Infallible with the never type once it is stabilized. + unreachable!(); } else { let _ = close(write_pipe); diff --git a/src/lib.rs b/src/lib.rs index 0af87b3..548097c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,6 +1,5 @@ #![feature(asm)] #![feature(llvm_asm)] -#![feature(never_type)] #![cfg_attr(not(test), no_std)] #[cfg(test)]