rust-lang-deprecated / error-chain

Error boilerplate for Rust
Apache License 2.0
729 stars 111 forks source link

Backtraces shouldn't need to be resolved unless necessary #221

Open Marwes opened 6 years ago

Marwes commented 6 years ago

Currently backtraces are resolved immediately via Backtrace::new https://github.com/rust-lang-nursery/error-chain/blob/c9b37574d4cbcc1c27a1a72de928c77f447e56ac/src/lib.rs#L616 but the backtrace crate also supports constructing an unresolved backtrace. Is there any reason why a resolved backtrace is constructed instead of an unresolved?

If error-chain constructed a resolved backtrace lazily instead of immediately that could be a nice performance boost (as indicated by the backtrace docs).

Yamakaky commented 6 years ago

Oh nice, I started https://github.com/alexcrichton/backtrace-rs/pull/32 but never finished it. Do you want to do a PR to integrate this feature?

Marwes commented 6 years ago

@Yamakaky Got a bunch of projects and PRs in in progress already but if I get some time I may look into it.

I will post if I start working on this though.

Yamakaky commented 6 years ago

Same ;)