diff --git a/reverie-ptrace/src/gdbstub/response.rs b/reverie-ptrace/src/gdbstub/response.rs index a8da1f3..d3977c2 100644 --- a/reverie-ptrace/src/gdbstub/response.rs +++ b/reverie-ptrace/src/gdbstub/response.rs @@ -66,12 +66,6 @@ impl WriteResponse for ResponseOk { } } -impl WriteResponse for ! { - fn write_response(&self, f: &mut ResponseWriter) { - ResponseNone.write_response(f) - } -} - impl WriteResponse for ResponseAsPlain where T: AsRef<[u8]>, diff --git a/reverie-ptrace/src/lib.rs b/reverie-ptrace/src/lib.rs index f9ab914..72b4296 100644 --- a/reverie-ptrace/src/lib.rs +++ b/reverie-ptrace/src/lib.rs @@ -29,7 +29,6 @@ #![deny(missing_docs)] #![deny(rustdoc::broken_intra_doc_links)] #![feature(internal_output_capture)] -#![feature(never_type)] mod children; mod cp; diff --git a/reverie-ptrace/src/task.rs b/reverie-ptrace/src/task.rs index 00968cf..36bd6c8 100644 --- a/reverie-ptrace/src/task.rs +++ b/reverie-ptrace/src/task.rs @@ -43,6 +43,7 @@ use reverie::Frame; use reverie::GlobalRPC; use reverie::GlobalTool; use reverie::Guest; +use reverie::Never; use reverie::Pid; #[cfg(target_arch = "x86_64")] use reverie::Rdtsc; @@ -1275,7 +1276,7 @@ impl TracedTask { // Wait on a future that will never complete. This pending future will // be dropped when the channel receives the event just sent. - future::pending::().await + future::pending().await } /// Marks the current task as exited via a channel. The receiver end of the @@ -1698,7 +1699,7 @@ impl TracedTask { Ok(_) => { // Drop the handle_syscall_event future. self.notifier.notify_one(); - future::pending::().await + future::pending().await } Err(err) => self.abort(Err(err)).await, } @@ -2161,7 +2162,7 @@ impl Guest for TracedTask { } #[allow(unreachable_code)] - async fn tail_inject(&mut self, syscall: S) -> ! { + async fn tail_inject(&mut self, syscall: S) -> Never { // Call a non-templatized function to reduce code bloat. let (nr, args) = syscall.into_parts(); self.do_tail_inject(nr, args).await diff --git a/reverie/Cargo.toml b/reverie/Cargo.toml index bc96524..6e1284f 100644 --- a/reverie/Cargo.toml +++ b/reverie/Cargo.toml @@ -18,6 +18,7 @@ lazy_static = "1.4" libc = "0.2.137" linked-hash-map = { version = "0.5", features = ["serde_impl"] } memmap = "0.7" +never-say-never = "6" nix = "0.25" object = { version = "0.29", features = ["write"] } procfs = "0.9" diff --git a/reverie/src/guest.rs b/reverie/src/guest.rs index ecc58b5..21b27c1 100644 --- a/reverie/src/guest.rs +++ b/reverie/src/guest.rs @@ -21,6 +21,7 @@ use crate::timer::TimerSchedule; use crate::tool::GlobalRPC; use crate::tool::GlobalTool; use crate::tool::Tool; +use crate::Never; use crate::Pid; /// A representation of a guest task (thread). @@ -152,7 +153,7 @@ pub trait Guest: Send + GlobalRPC { /// } /// } /// ``` - async fn tail_inject(&mut self, syscall: S) -> !; + async fn tail_inject(&mut self, syscall: S) -> Never; /// Like [`Guest::inject`], but will retry the syscall if `EINTR` or /// `ERESTARTSYS` are returned. @@ -350,7 +351,7 @@ where self.inner.inject(syscall).await } - async fn tail_inject(&mut self, syscall: S) -> ! { + async fn tail_inject(&mut self, syscall: S) -> Never { #![allow(unreachable_code)] self.inner.tail_inject(syscall).await } diff --git a/reverie/src/lib.rs b/reverie/src/lib.rs index d290eff..0085611 100644 --- a/reverie/src/lib.rs +++ b/reverie/src/lib.rs @@ -9,7 +9,6 @@ #![doc = include_str!("../../README.md")] #![deny(missing_docs)] #![deny(rustdoc::broken_intra_doc_links)] -#![feature(never_type)] mod auxv; mod backtrace; @@ -65,3 +64,6 @@ pub use nix::sys::signal::Signal; pub use raw_cpuid::CpuIdResult; /// typed syscalls. pub use reverie_syscalls as syscalls; + +/// `Never` type is a stopgap for the unstable `!` type (i.e., the never type). +pub type Never = never_say_never::Never;