Diffstat (limited to 'src/any.rs')
| -rw-r--r-- | src/any.rs | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -11,7 +11,7 @@ use core::marker::PhantomData; use effectful::{ bound::IsSync, - environment::{DynBind, EnvConfig, Environment, InEnvironment}, + environment::{DynBind, EnvConfig, Environment, InEnvironment}, SendSync, }; pub use static_wrapper::*; pub use type_name_id::*; @@ -27,7 +27,7 @@ pub enum LifetimeType {} pub mod TypeName { use effectful::environment::{DynBind, EnvConfig}; - pub trait MemberTypeForLt<'a, 'ctx: 'a, E: EnvConfig, B> { + pub trait MemberTypeForLt<'a, 'ctx: 'a, E: EnvConfig, B>: DynBind<E> { type T: ?Sized + LowerTypeWithBound<'a, 'ctx, E, &'a &'ctx (), Higher = Self>; } @@ -60,6 +60,7 @@ pub mod TypeName { <__ as LowerTypeWithBound<'a, 'ctx, E, &'a &'ctx ()>>::Higher; } +#[derive(SendSync)] pub struct RefHrt<T: ?Sized>(Marker<T>); impl<'a, 'lt, T: ?Sized, E: EnvConfig, B> TypeName::MemberTypeForLt<'a, 'lt, E, &'a &'lt B> @@ -80,6 +81,7 @@ where type Higher = RefHrt<<T as TypeName::LowerTypeWithBound<'a, 'lt, E, &'a &'lt B>>::Higher>; } +#[derive(SendSync)] pub struct MutHrt<T: ?Sized>(Marker<T>); impl<'a, 'lt, T: ?Sized, E: EnvConfig, B> TypeName::MemberTypeForLt<'a, 'lt, E, &'a &'lt B> @@ -431,6 +433,7 @@ impl<'a, 'ctx, I: Indirect<'a>, E: EnvConfig> AnyTraitObject<'a, 'ctx, I, E> { // // See the tests at the bottom of the file for a proof that the type name is bijective // to T. + #[allow(unsafe_code)] Ok(unsafe { self.indirect.into_inner::<T>() }) } else { Err(self) |