Skip to content

Commit 4578e94

Browse files
committed
Update readme/misc
1 parent fbcfd0e commit 4578e94

File tree

5 files changed

+5
-36
lines changed

5 files changed

+5
-36
lines changed

README.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,12 @@ backtrace like libstd's panics.
1414
backtrace = "0.3"
1515
```
1616

17-
Note that this crate requires `cc` and `ar` to be present on Unix systems when
18-
`libbacktrace` is used (which is the default). For configuring C compilers see
19-
the [`cc` crate documentation](https://github.com/alexcrichton/cc-rs).
20-
2117
## Usage
2218

2319
To simply capture a backtrace and defer dealing with it until a later time,
2420
you can use the top-level `Backtrace` type.
2521

2622
```rust
27-
extern crate backtrace;
28-
2923
use backtrace::Backtrace;
3024

3125
fn main() {
@@ -41,8 +35,6 @@ If, however, you'd like more raw access to the actual tracing functionality, you
4135
can use the `trace` and `resolve` functions directly.
4236

4337
```rust
44-
extern crate backtrace;
45-
4638
fn main() {
4739
backtrace::trace(|frame| {
4840
let ip = frame.ip();

src/backtrace/libunwind.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,14 +82,14 @@ impl Clone for Frame {
8282
}
8383

8484
#[inline(always)]
85-
pub unsafe fn trace(mut cb: &mut FnMut(&super::Frame) -> bool) {
85+
pub unsafe fn trace(mut cb: &mut dyn FnMut(&super::Frame) -> bool) {
8686
uw::_Unwind_Backtrace(trace_fn, &mut cb as *mut _ as *mut _);
8787

8888
extern "C" fn trace_fn(
8989
ctx: *mut uw::_Unwind_Context,
9090
arg: *mut c_void,
9191
) -> uw::_Unwind_Reason_Code {
92-
let cb = unsafe { &mut *(arg as *mut &mut FnMut(&super::Frame) -> bool) };
92+
let cb = unsafe { &mut *(arg as *mut &mut dyn FnMut(&super::Frame) -> bool) };
9393
let cx = super::Frame {
9494
inner: Frame::Raw(ctx),
9595
};

src/lib.rs

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,6 @@
66
//! parsed, for example, and expose the functionality of multiple backend
77
//! implementations.
88
//!
9-
//! # Implementation
10-
//!
11-
//! This library makes use of a number of strategies for actually acquiring a
12-
//! backtrace. For example unix uses libgcc's libunwind bindings by default to
13-
//! acquire a backtrace, but coresymbolication or dladdr is used on OSX to
14-
//! acquire symbol names while linux uses gcc's libbacktrace.
15-
//!
16-
//! When using the default feature set of this library the "most reasonable" set
17-
//! of defaults is chosen for the current platform, but the features activated
18-
//! can also be controlled at a finer granularity.
19-
//!
20-
//! # API Principles
21-
//!
22-
//! This library attempts to be as flexible as possible to accommodate different
23-
//! backend implementations of acquiring a backtrace. Consequently the currently
24-
//! exported functions are closure-based as opposed to the likely expected
25-
//! iterator-based versions. This is done due to limitations of the underlying
26-
//! APIs used from the system.
27-
//!
289
//! # Usage
2910
//!
3011
//! First, add this to your Cargo.toml
@@ -37,8 +18,6 @@
3718
//! Next:
3819
//!
3920
//! ```
40-
//! extern crate backtrace;
41-
//!
4221
//! fn main() {
4322
//! # // Unsafe here so test passes on no_std.
4423
//! # #[cfg(feature = "std")] {
@@ -69,8 +48,6 @@
6948
all(feature = "std", target_env = "sgx", target_vendor = "fortanix"),
7049
feature(sgx_platform)
7150
)]
72-
#![allow(bare_trait_objects)] // TODO: remove when updating to 2018 edition
73-
#![allow(rust_2018_idioms)] // TODO: remove when updating to 2018 edition
7451

7552
#[cfg(feature = "std")]
7653
#[macro_use]

src/print.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ pub struct BacktraceFmt<'a, 'b> {
1616
fmt: &'a mut fmt::Formatter<'b>,
1717
frame_index: usize,
1818
format: PrintFmt,
19-
print_path: &'a mut (FnMut(&mut fmt::Formatter, BytesOrWideString) -> fmt::Result + 'b),
19+
print_path: &'a mut (dyn FnMut(&mut fmt::Formatter, BytesOrWideString) -> fmt::Result + 'b),
2020
}
2121

2222
/// The styles of printing that we can print
@@ -41,7 +41,7 @@ impl<'a, 'b> BacktraceFmt<'a, 'b> {
4141
pub fn new(
4242
fmt: &'a mut fmt::Formatter<'b>,
4343
format: PrintFmt,
44-
print_path: &'a mut (FnMut(&mut fmt::Formatter, BytesOrWideString) -> fmt::Result + 'b),
44+
print_path: &'a mut (dyn FnMut(&mut fmt::Formatter, BytesOrWideString) -> fmt::Result + 'b),
4545
) -> Self {
4646
BacktraceFmt {
4747
fmt,

src/symbolize/gimli.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ impl Cache {
459459
}
460460
}
461461

462-
pub unsafe fn resolve(what: ResolveWhat, cb: &mut FnMut(&super::Symbol)) {
462+
pub unsafe fn resolve(what: ResolveWhat, cb: &mut dyn FnMut(&super::Symbol)) {
463463
let addr = what.address_or_ip();
464464
let mut call = |sym: Symbol| {
465465
// Extend the lifetime of `sym` to `'static` since we are unfortunately

0 commit comments

Comments
 (0)