From 9381057f76a3cbd4e2cc6de931a40a8f14ec610a Mon Sep 17 00:00:00 2001 From: Sebastian Zivota Date: Fri, 29 Nov 2024 11:40:22 +0100 Subject: [PATCH] Forgot a bunch --- symbolic-common/src/cell.rs | 16 ++++++++-------- symbolic-debuginfo/src/breakpad.rs | 2 +- symbolic-debuginfo/src/dwarf.rs | 4 ++-- symbolic-debuginfo/src/elf.rs | 2 +- symbolic-debuginfo/src/macho/bcsymbolmap.rs | 2 +- symbolic-debuginfo/src/macho/mod.rs | 6 +++--- symbolic-debuginfo/src/object.rs | 4 ++-- symbolic-debuginfo/src/pdb.rs | 8 ++++---- symbolic-debuginfo/src/pe.rs | 2 +- symbolic-debuginfo/src/sourcebundle.rs | 4 ++-- symbolic-debuginfo/src/wasm.rs | 2 +- symbolic-ppdb/src/cache/mod.rs | 2 +- symbolic-sourcemapcache/src/lookup.rs | 2 +- 13 files changed, 28 insertions(+), 28 deletions(-) diff --git a/symbolic-common/src/cell.rs b/symbolic-common/src/cell.rs index 19ce3d4eb..671422a40 100644 --- a/symbolic-common/src/cell.rs +++ b/symbolic-common/src/cell.rs @@ -80,7 +80,7 @@ pub trait AsSelf<'slf> { type Ref: ?Sized; /// Returns a reference to `self` with downcasted lifetime. - fn as_self(&'slf self) -> &Self::Ref; + fn as_self(&'slf self) -> &'slf Self::Ref; } impl AsSelf<'_> for u8 { @@ -106,7 +106,7 @@ where { type Ref = [T::Ref]; - fn as_self(&'slf self) -> &Self::Ref { + fn as_self(&'slf self) -> &'slf Self::Ref { unsafe { &*(self as *const [T] as *const [T::Ref]) } } } @@ -117,7 +117,7 @@ where { type Ref = T::Ref; - fn as_self(&'slf self) -> &Self::Ref { + fn as_self(&'slf self) -> &'slf Self::Ref { (*self).as_self() } } @@ -128,7 +128,7 @@ where { type Ref = T::Ref; - fn as_self(&'slf self) -> &Self::Ref { + fn as_self(&'slf self) -> &'slf Self::Ref { (**self).as_self() } } @@ -140,7 +140,7 @@ where { type Ref = [T::Ref]; - fn as_self(&'slf self) -> &Self::Ref { + fn as_self(&'slf self) -> &'slf Self::Ref { (**self).as_self() } } @@ -151,7 +151,7 @@ where { type Ref = T::Ref; - fn as_self(&'slf self) -> &Self::Ref { + fn as_self(&'slf self) -> &'slf Self::Ref { (**self).as_self() } } @@ -162,7 +162,7 @@ where { type Ref = T::Ref; - fn as_self(&'slf self) -> &Self::Ref { + fn as_self(&'slf self) -> &'slf Self::Ref { (**self).as_self() } } @@ -368,7 +368,7 @@ mod tests { impl<'slf> AsSelf<'slf> for Foo<'_> { type Ref = Foo<'slf>; - fn as_self(&'slf self) -> &Self::Ref { + fn as_self(&'slf self) -> &'slf Self::Ref { self } } diff --git a/symbolic-debuginfo/src/breakpad.rs b/symbolic-debuginfo/src/breakpad.rs index 94e4803c4..2713580d6 100644 --- a/symbolic-debuginfo/src/breakpad.rs +++ b/symbolic-debuginfo/src/breakpad.rs @@ -1159,7 +1159,7 @@ impl fmt::Debug for BreakpadObject<'_> { impl<'slf, 'data: 'slf> AsSelf<'slf> for BreakpadObject<'data> { type Ref = BreakpadObject<'slf>; - fn as_self(&'slf self) -> &Self::Ref { + fn as_self(&'slf self) -> &'slf Self::Ref { self } } diff --git a/symbolic-debuginfo/src/dwarf.rs b/symbolic-debuginfo/src/dwarf.rs index b33bf648b..541a5e6f2 100644 --- a/symbolic-debuginfo/src/dwarf.rs +++ b/symbolic-debuginfo/src/dwarf.rs @@ -1230,7 +1230,7 @@ impl<'d> DwarfInfo<'d> { } /// Returns an iterator over all compilation units. - fn units(&'d self, bcsymbolmap: Option<&'d BcSymbolMap<'d>>) -> DwarfUnitIterator<'_> { + fn units(&'d self, bcsymbolmap: Option<&'d BcSymbolMap<'d>>) -> DwarfUnitIterator<'d> { DwarfUnitIterator { info: self, bcsymbolmap, @@ -1242,7 +1242,7 @@ impl<'d> DwarfInfo<'d> { impl<'slf, 'd: 'slf> AsSelf<'slf> for DwarfInfo<'d> { type Ref = DwarfInfo<'slf>; - fn as_self(&'slf self) -> &Self::Ref { + fn as_self(&'slf self) -> &'slf Self::Ref { unsafe { std::mem::transmute(self) } } } diff --git a/symbolic-debuginfo/src/elf.rs b/symbolic-debuginfo/src/elf.rs index cdaddb4a9..768e122e1 100644 --- a/symbolic-debuginfo/src/elf.rs +++ b/symbolic-debuginfo/src/elf.rs @@ -746,7 +746,7 @@ impl fmt::Debug for ElfObject<'_> { impl<'slf, 'data: 'slf> AsSelf<'slf> for ElfObject<'data> { type Ref = ElfObject<'slf>; - fn as_self(&'slf self) -> &Self::Ref { + fn as_self(&'slf self) -> &'slf Self::Ref { self } } diff --git a/symbolic-debuginfo/src/macho/bcsymbolmap.rs b/symbolic-debuginfo/src/macho/bcsymbolmap.rs index 59dbf98a1..bd9c6c70d 100644 --- a/symbolic-debuginfo/src/macho/bcsymbolmap.rs +++ b/symbolic-debuginfo/src/macho/bcsymbolmap.rs @@ -78,7 +78,7 @@ impl From for BcSymbolMapError { impl<'slf> AsSelf<'slf> for BcSymbolMap<'_> { type Ref = BcSymbolMap<'slf>; - fn as_self(&'slf self) -> &Self::Ref { + fn as_self(&'slf self) -> &'slf Self::Ref { self } } diff --git a/symbolic-debuginfo/src/macho/mod.rs b/symbolic-debuginfo/src/macho/mod.rs index dc858e788..d09f47676 100644 --- a/symbolic-debuginfo/src/macho/mod.rs +++ b/symbolic-debuginfo/src/macho/mod.rs @@ -375,7 +375,7 @@ impl fmt::Debug for MachObject<'_> { impl<'slf, 'd: 'slf> AsSelf<'slf> for MachObject<'d> { type Ref = MachObject<'slf>; - fn as_self(&'slf self) -> &Self::Ref { + fn as_self(&'slf self) -> &'slf Self::Ref { self } } @@ -647,7 +647,7 @@ impl fmt::Debug for FatMachO<'_> { impl<'slf, 'd: 'slf> AsSelf<'slf> for FatMachO<'d> { type Ref = FatMachO<'slf>; - fn as_self(&'slf self) -> &Self::Ref { + fn as_self(&'slf self) -> &'slf Self::Ref { self } } @@ -796,7 +796,7 @@ impl<'d> MachArchive<'d> { impl<'slf, 'd: 'slf> AsSelf<'slf> for MachArchive<'d> { type Ref = MachArchive<'slf>; - fn as_self(&'slf self) -> &Self::Ref { + fn as_self(&'slf self) -> &'slf Self::Ref { self } } diff --git a/symbolic-debuginfo/src/object.rs b/symbolic-debuginfo/src/object.rs index 1ebb1148c..8cd5260f6 100644 --- a/symbolic-debuginfo/src/object.rs +++ b/symbolic-debuginfo/src/object.rs @@ -371,7 +371,7 @@ impl<'data> Object<'data> { impl<'slf, 'data: 'slf> AsSelf<'slf> for Object<'data> { type Ref = Object<'slf>; - fn as_self(&'slf self) -> &Self::Ref { + fn as_self(&'slf self) -> &'slf Self::Ref { unsafe { std::mem::transmute(self) } } } @@ -758,7 +758,7 @@ impl<'d> Archive<'d> { impl<'slf, 'd: 'slf> AsSelf<'slf> for Archive<'d> { type Ref = Archive<'slf>; - fn as_self(&'slf self) -> &Self::Ref { + fn as_self(&'slf self) -> &'slf Self::Ref { unsafe { std::mem::transmute(self) } } } diff --git a/symbolic-debuginfo/src/pdb.rs b/symbolic-debuginfo/src/pdb.rs index bad07160e..a30759650 100644 --- a/symbolic-debuginfo/src/pdb.rs +++ b/symbolic-debuginfo/src/pdb.rs @@ -298,7 +298,7 @@ impl fmt::Debug for PdbObject<'_> { impl<'slf, 'data: 'slf> AsSelf<'slf> for PdbObject<'data> { type Ref = PdbObject<'slf>; - fn as_self(&'slf self) -> &Self::Ref { + fn as_self(&'slf self) -> &'slf Self::Ref { unsafe { std::mem::transmute(self) } } } @@ -565,7 +565,7 @@ impl<'d> PdbDebugInfo<'d> { } /// Returns an iterator over all compilation units (modules). - fn units(&'d self) -> PdbUnitIterator<'_> { + fn units(&'d self) -> PdbUnitIterator<'d> { PdbUnitIterator { debug_info: self, index: 0, @@ -576,7 +576,7 @@ impl<'d> PdbDebugInfo<'d> { self.type_formatter.modules() } - fn get_module(&'d self, index: usize) -> Result>, PdbError> { + fn get_module(&'d self, index: usize) -> Result>, PdbError> { // Silently ignore module references out-of-bound let module = match self.modules().get(index) { Some(module) => module, @@ -599,7 +599,7 @@ impl<'d> PdbDebugInfo<'d> { impl<'slf, 'd: 'slf> AsSelf<'slf> for PdbDebugInfo<'d> { type Ref = PdbDebugInfo<'slf>; - fn as_self(&'slf self) -> &Self::Ref { + fn as_self(&'slf self) -> &'slf Self::Ref { unsafe { std::mem::transmute(self) } } } diff --git a/symbolic-debuginfo/src/pe.rs b/symbolic-debuginfo/src/pe.rs index c4a371382..ba33156d5 100644 --- a/symbolic-debuginfo/src/pe.rs +++ b/symbolic-debuginfo/src/pe.rs @@ -377,7 +377,7 @@ impl fmt::Debug for PeObject<'_> { impl<'slf, 'data: 'slf> AsSelf<'slf> for PeObject<'data> { type Ref = PeObject<'slf>; - fn as_self(&'slf self) -> &Self::Ref { + fn as_self(&'slf self) -> &'slf Self::Ref { self } } diff --git a/symbolic-debuginfo/src/sourcebundle.rs b/symbolic-debuginfo/src/sourcebundle.rs index 4eeeb8e7d..1dbce62c7 100644 --- a/symbolic-debuginfo/src/sourcebundle.rs +++ b/symbolic-debuginfo/src/sourcebundle.rs @@ -784,7 +784,7 @@ impl<'data> SourceBundle<'data> { impl<'slf, 'data: 'slf> AsSelf<'slf> for SourceBundle<'data> { type Ref = SourceBundle<'slf>; - fn as_self(&'slf self) -> &Self::Ref { + fn as_self(&'slf self) -> &'slf Self::Ref { unsafe { std::mem::transmute(self) } } } @@ -991,7 +991,7 @@ impl<'session> DebugSession<'session> for SourceBundleDebugSession<'_> { impl<'slf, 'data: 'slf> AsSelf<'slf> for SourceBundleDebugSession<'data> { type Ref = SourceBundleDebugSession<'slf>; - fn as_self(&'slf self) -> &Self::Ref { + fn as_self(&'slf self) -> &'slf Self::Ref { unsafe { std::mem::transmute(self) } } } diff --git a/symbolic-debuginfo/src/wasm.rs b/symbolic-debuginfo/src/wasm.rs index a23bc3a31..bafd252d3 100644 --- a/symbolic-debuginfo/src/wasm.rs +++ b/symbolic-debuginfo/src/wasm.rs @@ -169,7 +169,7 @@ impl fmt::Debug for WasmObject<'_> { impl<'slf, 'd: 'slf> AsSelf<'slf> for WasmObject<'d> { type Ref = WasmObject<'slf>; - fn as_self(&'slf self) -> &Self::Ref { + fn as_self(&'slf self) -> &'slf Self::Ref { self } } diff --git a/symbolic-ppdb/src/cache/mod.rs b/symbolic-ppdb/src/cache/mod.rs index d1de297ce..f387e9afa 100644 --- a/symbolic-ppdb/src/cache/mod.rs +++ b/symbolic-ppdb/src/cache/mod.rs @@ -222,7 +222,7 @@ impl std::fmt::Debug for PortablePdbCache<'_> { impl<'slf, 'd: 'slf> AsSelf<'slf> for PortablePdbCache<'d> { type Ref = PortablePdbCache<'slf>; - fn as_self(&'slf self) -> &Self::Ref { + fn as_self(&'slf self) -> &'slf Self::Ref { self } } diff --git a/symbolic-sourcemapcache/src/lookup.rs b/symbolic-sourcemapcache/src/lookup.rs index d1d70e0e9..4e613d4f1 100644 --- a/symbolic-sourcemapcache/src/lookup.rs +++ b/symbolic-sourcemapcache/src/lookup.rs @@ -82,7 +82,7 @@ pub struct SourceMapCache<'data> { impl<'slf, 'a: 'slf> AsSelf<'slf> for SourceMapCache<'a> { type Ref = SourceMapCache<'slf>; - fn as_self(&'slf self) -> &Self::Ref { + fn as_self(&'slf self) -> &'slf Self::Ref { self } }