Skip to content

Commit e1d1fb5

Browse files
authored
Merge pull request #1 from BoxyUwU/new-new-new-devices
Remove implicit object lifetime cast (unbreak rrtk on Rust 1.94+)
2 parents df5d0e0 + ec908bf commit e1d1fb5

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

src/lib.rs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -791,39 +791,39 @@ macro_rules! as_dyn_chronology {
791791
///the original `PointerDereferencer`. Unfortunately `T` currently must be `Sized` due to language
792792
///limitations.
793793
impl<T> PointerDereferencer<*mut T> {
794-
as_dyn_updatable!(*mut dyn Updatable<E>);
795-
as_dyn_getter!(*mut dyn Getter<U, E>);
796-
as_dyn_settable!(*mut dyn Settable<U, E>);
797-
as_dyn_time_getter!(*mut dyn TimeGetter<E>);
798-
as_dyn_chronology!(*mut dyn Chronology<U>);
794+
as_dyn_updatable!(*mut (dyn Updatable<E> + '_));
795+
as_dyn_getter!(*mut (dyn Getter<U, E> + '_));
796+
as_dyn_settable!(*mut (dyn Settable<U, E> + '_));
797+
as_dyn_time_getter!(*mut (dyn TimeGetter<E> + '_));
798+
as_dyn_chronology!(*mut (dyn Chronology<U> + '_));
799799
}
800800
///These functions get a `PointerDereferencer<*const RwLock<dyn Trait>>` from a
801801
///`PointerDereferencer<*const RwLock<T>>` where `T: Trait`. Because raw pointers are `Copy`, they
802802
///only require `&self` and do not consume the original `PointerDereferencer`. Unfortunately `T`
803803
///currently must be `Sized` due to language limitations.
804804
#[cfg(feature = "std")]
805805
impl<T> PointerDereferencer<*const RwLock<T>> {
806-
as_dyn_updatable!(*const RwLock<dyn Updatable<E>>);
807-
as_dyn_getter!(*const RwLock<dyn Getter<U, E>>);
808-
as_dyn_settable!(*const RwLock<dyn Settable<U, E>>);
809-
as_dyn_time_getter!(*const RwLock<dyn TimeGetter<E>>);
806+
as_dyn_updatable!(*const RwLock<dyn Updatable<E> + '_>);
807+
as_dyn_getter!(*const RwLock<dyn Getter<U, E> + '_>);
808+
as_dyn_settable!(*const RwLock<dyn Settable<U, E> + '_>);
809+
as_dyn_time_getter!(*const RwLock<dyn TimeGetter<E> + '_>);
810810
}
811811
///These functions get a `PointerDereferencer<*const Mutex<dyn Trait>>` from a
812812
///`PointerDereferencer<*const Mutex<T>>` where `T: Trait`. Because raw pointers are `Copy`, they
813813
///only require `&self` and do not consume the original `PointerDereferencer`. Unfortunately `T`
814814
///currently must be `Sized` due to language limitations.
815815
#[cfg(feature = "std")]
816816
impl<T> PointerDereferencer<*const Mutex<T>> {
817-
as_dyn_updatable!(*const Mutex<dyn Updatable<E>>);
818-
as_dyn_getter!(*const Mutex<dyn Getter<U, E>>);
819-
as_dyn_settable!(*const Mutex<dyn Settable<U, E>>);
820-
as_dyn_time_getter!(*const Mutex<dyn TimeGetter<E>>);
817+
as_dyn_updatable!(*const Mutex<dyn Updatable<E> + '_>);
818+
as_dyn_getter!(*const Mutex<dyn Getter<U, E> + '_>);
819+
as_dyn_settable!(*const Mutex<dyn Settable<U, E> + '_>);
820+
as_dyn_time_getter!(*const Mutex<dyn TimeGetter<E> + '_>);
821821
}
822822
//There are Chronology impls for RwLock<C> and Mutex<C> where C: Chronology. It is necessary to
823823
//implement Updatable etc. for *const RwLock<T> and *const Mutex<T> directly rather than doing it
824824
//more generically like for Chronology because they require mutability.
825825
impl<T> PointerDereferencer<*const T> {
826-
as_dyn_chronology!(*const dyn Chronology<U>);
826+
as_dyn_chronology!(*const (dyn Chronology<U> + '_));
827827
}
828828
//FIXME: Make one of these work if you can, preferably From since it implies Into.
829829
/*impl<P> From<PointerDereferencer<P>> for P {

0 commit comments

Comments
 (0)