From d4f24b139765afe73bd9c18b0d8eaed7630c883c Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Tue, 9 Jun 2020 14:25:31 -0700 Subject: [PATCH] Fix anonymous lifetime warnings for libbacktrace --- src/symbolize/libbacktrace.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/symbolize/libbacktrace.rs b/src/symbolize/libbacktrace.rs index 0c38efc9b..6afd1abe5 100644 --- a/src/symbolize/libbacktrace.rs +++ b/src/symbolize/libbacktrace.rs @@ -57,7 +57,7 @@ pub enum Symbol<'a> { } impl Symbol<'_> { - pub fn name(&self) -> Option { + pub fn name(&self) -> Option> { let symbol = |ptr: *const c_char| unsafe { if ptr.is_null() { None @@ -119,7 +119,7 @@ impl Symbol<'_> { } } - pub fn filename_raw(&self) -> Option { + pub fn filename_raw(&self) -> Option> { self.filename_bytes().map(BytesOrWideString::Bytes) } @@ -178,7 +178,7 @@ extern "C" fn syminfo_cb( // not debug info, so if that happens we're sure to call the callback with // at least one symbol from the `syminfo_cb`. unsafe { - let syminfo_state = &mut *(data as *mut SyminfoState); + let syminfo_state = &mut *(data as *mut SyminfoState<'_>); let mut pcinfo_state = PcinfoState { symname, called: false, @@ -222,7 +222,7 @@ extern "C" fn pcinfo_cb( let mut bomb = crate::Bomb { enabled: true }; unsafe { - let state = &mut *(data as *mut PcinfoState); + let state = &mut *(data as *mut PcinfoState<'_>); state.called = true; (state.cb)(&super::Symbol { inner: Symbol::Pcinfo { @@ -438,7 +438,7 @@ unsafe fn init_state() -> *mut bt::backtrace_state { } } -pub unsafe fn resolve(what: ResolveWhat, cb: &mut dyn FnMut(&super::Symbol)) { +pub unsafe fn resolve(what: ResolveWhat<'_>, cb: &mut dyn FnMut(&super::Symbol)) { let symaddr = what.address_or_ip() as usize; // backtrace errors are currently swept under the rug