diff --git a/src/path/standard.rs b/src/path/standard.rs index f210d1a8..d8cd0a89 100644 --- a/src/path/standard.rs +++ b/src/path/standard.rs @@ -159,10 +159,6 @@ impl RefClonable for SimplePath where E: Env, S: SubPath + Send+Syn } } -unsafe impl Statize for SimplePath where E: Env, S: SubPath + Send+Sync + 'static { - type Statur = Self; -} - //TODO fix the AsWidget generic impl /*impl AsWidget<'static,E> for SimplePath where E: Env { fn as_ref<'s>(&'s self) -> Resolvable<'s,E> where 'static: 's { diff --git a/src/validation/mod.rs b/src/validation/mod.rs index 0d9b7a7f..8685504e 100644 --- a/src/validation/mod.rs +++ b/src/validation/mod.rs @@ -27,11 +27,4 @@ pub trait ValidationMut: Validation { fn validate(&mut self) -> Arc; } -unsafe impl Statize for dyn Validation where E: 'static { - type Statur = dyn Validation; -} -unsafe impl Statize for dyn ValidationMut where E: 'static { - type Statur = dyn ValidationMut; -} - traitcast_for!(Validation;ValidationMut); diff --git a/src/widget/cast.rs b/src/widget/cast.rs index b6e2da70..e69de29b 100644 --- a/src/widget/cast.rs +++ b/src/widget/cast.rs @@ -1,120 +0,0 @@ -//! functionality for downcast or traitcast widget references -use super::*; - -//TODO simplify Statize and downcast impls into AnyLt struct -/// Trait for retrieving the TypeId of a non-'static type by providing the 'static variant of the type -/// -/// See [RFC 1849](https://github.com/rust-lang/rust/issues/41875) -#[deprecated] -pub unsafe trait Statize { - /// Must be `Self`, but with all lifetimes 'static - type Statur: ?Sized + 'static; - - #[inline(always)] - fn _typeid() -> TypeId { - TypeId::of::() - } -} - -/// StatizeSized is Statize but with Statur: Sized -/// -/// StatizeSized is implemented on all Statize where Statur: Sized -#[deprecated] -pub unsafe trait StatizeSized { - type StaturSized: Sized + 'static; //TODO rename to Statur - - #[inline(always)] - fn _typeid() -> TypeId { - TypeId::of::() - } -} - -#[allow(deprecated)] -mod imp { - use super::*; - use std::{borrow::Cow, path::{Path,PathBuf}, sync::Arc, rc::Rc}; - - unsafe impl StatizeSized for T where T: Statize, T::Statur: Sized { - type StaturSized = T::Statur; - } - - unsafe impl Statize for dyn Widget+'_ where E: Env { - type Statur = dyn Widget+'static; - } - unsafe impl<'w,E> Statize for dyn WidgetMut+'_ where E: Env { - type Statur = dyn WidgetMut+'static; - } - unsafe impl Statize for dyn Any { - type Statur = dyn Any; - } - - unsafe impl<'w,T,E> Statize for Box where T: Statize+?Sized { - type Statur = Box; - } - unsafe impl<'w,T,E> Statize for Rc where T: Statize+?Sized { - type Statur = Rc; - } - unsafe impl<'w,T,E> Statize for Arc where T: Statize+?Sized { - type Statur = Arc; - } - unsafe impl<'w,T,E> Statize for Vec where T: StatizeSized { - type Statur = Vec; - } - unsafe impl<'w,T,E> Statize for Option where T: StatizeSized { - type Statur = Option; - } - unsafe impl<'w,T,U,E> Statize for Result where T: StatizeSized, U: StatizeSized { - type Statur = Result; - } - unsafe impl<'w,T,E> Statize for Cow<'w,T> where T: Statize+Clone+?Sized, T::Statur: Clone { - type Statur = Cow<'static,T::Statur>; - } - unsafe impl<'w,T,E> Statize for &'w T where T: Statize+?Sized { - type Statur = &'static T::Statur; - } - unsafe impl<'w,T,E> Statize for &'w mut T where T: Statize+?Sized { - type Statur = &'static mut T::Statur; - } - unsafe impl<'w,T,E> Statize for [T] where T: StatizeSized { - type Statur = [T::StaturSized]; - } - - macro_rules! impl_statize_static { - ($t:ty;$($tt:ty);+) => { - impl_statize_static!($t); - impl_statize_static!($($tt);*); - }; - ($t:ty) => { - unsafe impl Statize for $t { - type Statur = Self; - } - } - } - - impl_statize_static!( - bool;char;(); - f32;f64; - i8;i16;i32;i64;i128;isize; - u8;u16;u32;u64;u128;usize; - str;String;//&'static str; - Path;PathBuf; - crate::widgets::textbox::state::Cursor; - StdID; - StdGonstraints;StdGonstraintAxis - ); - - macro_rules! impl_statize_tuple { - ($t:ident $($tt:ident)+) => { - impl_statize_tuple!($($tt)+); - - unsafe impl Statize for ($t,$($tt),+) where - $t: StatizeSized, - $($tt: StatizeSized),+ { - type Statur = ($t::StaturSized,$($tt::StaturSized),+); - } - }; - ($t:ident) => {} - } - - impl_statize_tuple!(A B C D F G H I J K L M N O P Q R S T U V W X Y Z AA AB AC AD AE AF AG); -} diff --git a/src/widgets/null/mod.rs b/src/widgets/null/mod.rs index d005f08d..7f579427 100644 --- a/src/widgets/null/mod.rs +++ b/src/widgets/null/mod.rs @@ -90,7 +90,3 @@ impl<'w,E> WidgetMut<'w,E> for Null where Err(()) } } - -unsafe impl Statize for Null where E: Env { - type Statur = Self; -} diff --git a/src/widgets/util/state.rs b/src/widgets/util/state.rs index 2b73ba81..c2285369 100644 --- a/src/widgets/util/state.rs +++ b/src/widgets/util/state.rs @@ -207,11 +207,4 @@ impl AtomState for &AtomStateOnSet where E: Env, A: AtomS } } -unsafe impl Statize for dyn AtomState where T: 'static, E: Env { - type Statur = dyn AtomState; -} -unsafe impl Statize for dyn AtomStateMut where T: 'static, E: Env { - type Statur = dyn AtomStateMut; -} - traitcast_for!( AtomState;AtomStateMut where T: 'static);