1- #![ cfg_attr( not( any ( feature = "std" , doc ) ) , no_std) ]
1+ #![ cfg_attr( not( feature = "std" ) , no_std) ]
22#![ cfg_attr(
3- any( feature = "global" , doc , all( feature = "std" , test) ) ,
3+ any( feature = "global" , all( feature = "std" , test) ) ,
44 feature( once_cell)
55) ]
66#![ feature(
77 doc_cfg,
8+ doc_cfg_hide,
89 generic_associated_types,
910 ptr_metadata,
1011 unsize,
11- option_result_unwrap_unchecked
12+ option_result_unwrap_unchecked,
1213) ]
1314#![ deny( missing_docs) ]
15+ #![ doc( cfg_hide( doc) ) ]
1416
1517//! rattish enables dynamic casting between different trait objects.
1618//!
2022//!
2123//! rattish is presently only experimental, and depends on unstable compiler
2224//! features including [`generic_associated_types`], [`ptr_metadata`] and
23- //! [`unsize`]; [`once_cell`] is used by [`DB`] (enabled by the `global`
24- //! feature). Accordingly, a nightly toolchain is required.
25+ //! [`unsize`].
26+ #![ cfg_attr( feature = "global" , doc = "[`once_cell`] is used by [`DB`] (enabled by the `global` feature)." ) ]
27+ //! Accordingly, a nightly toolchain is required.
2528//!
2629//! # Example
2730//! ```rust
9598//! [`ptr_metadata`]: https://doc.rust-lang.org/nightly/unstable-book/library-features/ptr-metadata.html
9699//! [`unsize`]: https://doc.rust-lang.org/nightly/unstable-book/library-features/unsize.html
97100
98- #[ cfg( all( any ( feature = "alloc" , doc ) , not( feature = "std" ) ) ) ]
101+ #[ cfg( all( feature = "alloc" , not( feature = "std" ) ) ) ]
99102extern crate alloc;
100103
101104pub mod container;
@@ -112,7 +115,7 @@ use db::{
112115 TypeDatabaseEntryExt , TypeDatabaseExt ,
113116} ;
114117
115- #[ cfg( any ( feature = "global" , doc ) ) ]
118+ #[ cfg( feature = "global" ) ]
116119use db:: { error:: DatabaseError , hash_map:: DB } ;
117120
118121#[ cfg( feature = "tracing" ) ]
@@ -181,8 +184,7 @@ where
181184{
182185}
183186
184- #[ cfg( any( feature = "global" , doc) ) ]
185- #[ doc( cfg( feature = "global" ) ) ]
187+ #[ cfg( feature = "global" ) ]
186188/// A type whose implementations can be dynamically determined using the global
187189/// [`DB`].
188190pub trait GlobalDynImplements
@@ -201,8 +203,7 @@ where
201203 }
202204}
203205
204- #[ cfg( any( feature = "global" , doc) ) ]
205- #[ doc( cfg( feature = "global" ) ) ]
206+ #[ cfg( feature = "global" ) ]
206207/// A type that can be dynamically cast using the global [`DB`].
207208pub trait GlobalDynCast
208209where
@@ -228,12 +229,10 @@ where
228229 }
229230}
230231
231- #[ cfg( any( feature = "global" , doc) ) ]
232- #[ doc( cfg( feature = "global" ) ) ]
232+ #[ cfg( feature = "global" ) ]
233233impl < P > GlobalDynImplements for P where Self : InnermostTypeId { }
234234
235- #[ cfg( any( feature = "global" , doc) ) ]
236- #[ doc( cfg( feature = "global" ) ) ]
235+ #[ cfg( feature = "global" ) ]
237236impl < P > GlobalDynCast for P
238237where
239238 Self : Pointer + InnermostTypeId ,
0 commit comments