From ec908bf0f045c58d026fa892a3ae5bf7885cf17f Mon Sep 17 00:00:00 2001 From: Boxy Uwu Date: Thu, 4 Dec 2025 19:03:09 +0000 Subject: [PATCH] Remove implicit object lifetime cast --- src/lib.rs | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index c45b8ae..b38aa52 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -791,11 +791,11 @@ macro_rules! as_dyn_chronology { ///the original `PointerDereferencer`. Unfortunately `T` currently must be `Sized` due to language ///limitations. impl PointerDereferencer<*mut T> { - as_dyn_updatable!(*mut dyn Updatable); - as_dyn_getter!(*mut dyn Getter); - as_dyn_settable!(*mut dyn Settable); - as_dyn_time_getter!(*mut dyn TimeGetter); - as_dyn_chronology!(*mut dyn Chronology); + as_dyn_updatable!(*mut (dyn Updatable + '_)); + as_dyn_getter!(*mut (dyn Getter + '_)); + as_dyn_settable!(*mut (dyn Settable + '_)); + as_dyn_time_getter!(*mut (dyn TimeGetter + '_)); + as_dyn_chronology!(*mut (dyn Chronology + '_)); } ///These functions get a `PointerDereferencer<*const RwLock>` from a ///`PointerDereferencer<*const RwLock>` where `T: Trait`. Because raw pointers are `Copy`, they @@ -803,10 +803,10 @@ impl PointerDereferencer<*mut T> { ///currently must be `Sized` due to language limitations. #[cfg(feature = "std")] impl PointerDereferencer<*const RwLock> { - as_dyn_updatable!(*const RwLock>); - as_dyn_getter!(*const RwLock>); - as_dyn_settable!(*const RwLock>); - as_dyn_time_getter!(*const RwLock>); + as_dyn_updatable!(*const RwLock + '_>); + as_dyn_getter!(*const RwLock + '_>); + as_dyn_settable!(*const RwLock + '_>); + as_dyn_time_getter!(*const RwLock + '_>); } ///These functions get a `PointerDereferencer<*const Mutex>` from a ///`PointerDereferencer<*const Mutex>` where `T: Trait`. Because raw pointers are `Copy`, they @@ -814,16 +814,16 @@ impl PointerDereferencer<*const RwLock> { ///currently must be `Sized` due to language limitations. #[cfg(feature = "std")] impl PointerDereferencer<*const Mutex> { - as_dyn_updatable!(*const Mutex>); - as_dyn_getter!(*const Mutex>); - as_dyn_settable!(*const Mutex>); - as_dyn_time_getter!(*const Mutex>); + as_dyn_updatable!(*const Mutex + '_>); + as_dyn_getter!(*const Mutex + '_>); + as_dyn_settable!(*const Mutex + '_>); + as_dyn_time_getter!(*const Mutex + '_>); } //There are Chronology impls for RwLock and Mutex where C: Chronology. It is necessary to //implement Updatable etc. for *const RwLock and *const Mutex directly rather than doing it //more generically like for Chronology because they require mutability. impl PointerDereferencer<*const T> { - as_dyn_chronology!(*const dyn Chronology); + as_dyn_chronology!(*const (dyn Chronology + '_)); } //FIXME: Make one of these work if you can, preferably From since it implies Into. /*impl

From> for P {