Construct Error with existing backtrace

Open
#462 0 comments 0 reactions 0 assignees View on GitHub

@sb123sb123 is already working on this.

Since Sep 22, 2026.

  • #463 by @sb123sb123 — open

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
55/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
rust
Domain
tooling

Research direction

Start by locating Error::new and the existing Backtrace handling in the anyhow source. Review how errors are currently constructed under stable Rust, then determine the public API shape for passing a previously captured Backtrace. Done means the requested construction path exists and is covered by tests for preserving the supplied backtrace.

Written by the indexing model from the issue text.

Description

Currently the only way to construct an anyhow::Error with a backtrace that we previously captured is through the (still) unstable error_generic_member_access feature. Would like to have a variant of the Error::new function that allows you to pass a Backtrace as well.

Dominant language
Rust
Stars
6.7k
Forks
232
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from dtolnay/anyhow

All issues in dtolnay/anyhow

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.