summaryrefslogtreecommitdiff
path: root/devel/sentry-cli/files/patch-rust1460
diff options
context:
space:
mode:
Diffstat (limited to 'devel/sentry-cli/files/patch-rust1460')
-rw-r--r--devel/sentry-cli/files/patch-rust146033
1 files changed, 33 insertions, 0 deletions
diff --git a/devel/sentry-cli/files/patch-rust1460 b/devel/sentry-cli/files/patch-rust1460
new file mode 100644
index 000000000000..cd6ae9b820bb
--- /dev/null
+++ b/devel/sentry-cli/files/patch-rust1460
@@ -0,0 +1,33 @@
+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<'_> {