Commit 131249b
committed
Remove 2 frames of noise from 'context' backtraces
Repro:
use anyhow::Context;
fn main() -> anyhow::Result<()> {
let result = Err(std::fmt::Error);
result.context("...")
}
Before:
0: <E as anyhow::context::ext::StdError>::ext_context
at /git/anyhow/src/context.rs:27:29
1: anyhow::context::<impl anyhow::Context<T,E> for core::result::Result<T,E>>::context::{{closure}}
at /git/anyhow/src/context.rs:50:30
2: core::result::Result<T,E>::map_err
at /rustc/4b8f4319954ff2642690b9e5cbe4af352d095bf6/library/core/src/result.rs:861:27
3: anyhow::context::<impl anyhow::Context<T,E> for core::result::Result<T,E>>::context
at /git/anyhow/src/context.rs:50:9
4: testing::main
at ./src/main.rs:5:5
After:
0: <E as anyhow::context::ext::StdError>::ext_context
at /git/anyhow/src/context.rs:27:29
1: anyhow::context::<impl anyhow::Context<T,E> for core::result::Result<T,E>>::context
at /git/anyhow/src/context.rs:52:31
2: testing::main
at ./src/main.rs:5:51 parent f2123ab commit 131249b
1 file changed
Lines changed: 10 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
51 | 56 | | |
52 | 57 | | |
53 | 58 | | |
54 | 59 | | |
55 | 60 | | |
56 | 61 | | |
57 | 62 | | |
58 | | - | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
59 | 67 | | |
60 | 68 | | |
61 | 69 | | |
| |||
0 commit comments