Changeset View
Changeset View
Standalone View
Standalone View
head/devel/sentry-cli/files/patch-rust1460
Property | Old Value | New Value |
---|---|---|
fbsd:nokeywords | null | yes \ No newline at end of property |
svn:eol-style | null | native \ No newline at end of property |
svn:mime-type | null | text/plain \ No newline at end of property |
From f56d3f4670bafb85b3b2cfece25fdc20d80416d9 Mon Sep 17 00:00:00 2001 | |||||
From: Jan Michael Auer <mail@jauer.org> | |||||
Date: Fri, 21 Aug 2020 15:17:25 +0200 | |||||
Subject: [PATCH] feat: Unsafe transmute for PDB symbols (#258) | |||||
This works around compilation errors on nightly when casting to the | |||||
generic `DynIterator` type. This is caused by invariant lifetimes on | |||||
PDB's stream type. The transmute is actually safe since the lifetime of | |||||
the data is proved to be larger than the lifetime of the derived object. | |||||
--- cargo-crates/symbolic-debuginfo-7.3.1/src/object.rs.orig 2020-05-14 17:21:46 UTC | |||||
+++ cargo-crates/symbolic-debuginfo-7.3.1/src/object.rs | |||||
@@ -345,7 +345,7 @@ impl<'d> ObjectLike for Object<'d> { | |||||
} | |||||
fn symbols(&self) -> DynIterator<'_, Symbol<'_>> { | |||||
- Box::new(self.symbols()) | |||||
+ unsafe { std::mem::transmute(Box::new(self.symbols()) as DynIterator<'_, _>) } | |||||
} | |||||
fn has_debug_info(&self) -> bool { | |||||
--- cargo-crates/symbolic-debuginfo-7.3.1/src/pdb.rs.orig 2020-05-14 17:21:46 UTC | |||||
+++ cargo-crates/symbolic-debuginfo-7.3.1/src/pdb.rs | |||||
@@ -291,7 +291,8 @@ impl<'d> ObjectLike for PdbObject<'d> { | |||||
} | |||||
fn symbols(&self) -> DynIterator<'_, Symbol<'_>> { | |||||
- Box::new(self.symbols()) | |||||
+ // TODO: Avoid this transmute by introducing explicit lifetimes on the trait. | |||||
+ unsafe { std::mem::transmute(Box::new(self.symbols()) as DynIterator<'_, _>) } | |||||
} | |||||
fn symbol_map(&self) -> SymbolMap<'_> { |