From 80bc839221ec90c099226bdf6b4396e35750c0aa Mon Sep 17 00:00:00 2001 From: Avril Date: Thu, 10 Sep 2020 13:27:23 +0100 Subject: [PATCH] add impossible type --- src/handle.rs | 4 +++- src/lib.rs | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/handle.rs b/src/handle.rs index b5b8629..1909866 100644 --- a/src/handle.rs +++ b/src/handle.rs @@ -5,10 +5,12 @@ use super::*; pub use types::{Handle,GhostHandle}; +#[cfg(not(nightly))] enum HandleInner{} + macro_rules! handle { ($name:ident, $inner_name:ident) => { #[cfg(nightly)] pub struct $inner_name(!); - #[cfg(not(nightly))] pub struct $inner_name(()); + #[cfg(not(nightly))] pub struct $inner_name(HandleInner); impl private::Sealed for $inner_name{} impl GhostHandle for $inner_name{} pub type $name = *mut Handle<$inner_name>; diff --git a/src/lib.rs b/src/lib.rs index d3ebab1..642a001 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -5,7 +5,7 @@ //! I've attempted to provide more Rust-idiomatic API variants as well, which have non-prefixed names. //! //! # Namespace polution and interface stablility -//! Eventually I intend to have /most/ (if not all) C compatable types either reimplemented or aliased to non-prefixed Rust types. +//! Eventually I think we should have *most* (if not all) C compatable types either reimplemented or aliased to non-prefixed Rust types. //! At present though this is not the case, and prefixed names that can double as ergonomic Rust types are not aliased to them, so you'll have to use both often. //! The reimplementation is undergoing, the aliasing not yet.