Skip to content

Record the caller's location in eyre reports, and test README examples in place - #270

Merged
soareschen merged 1 commit into
mainfrom
eyre-tracking
Sep 26, 2026
Merged

soareschen merged 1 commit into
mainfrom
eyre-tracking

Conversation

@soareschen

Copy link
Copy Markdown
Collaborator

CanRaiseError::raise_error and CanWrapError::wrap_error are now #[track_caller]. #[cgp_component] copies the attribute onto the provider trait's declaration, and Rust applies it to every impl, including the generated forwarding impls, so an error library that records Location::caller() sees the line that called raise_error. cgp-error-eyre turns eyre's track-caller feature back on, and a new eyre_location test checks the location through plain, open, and namespace-path wiring, for each eyre raiser and for RaiseFrom.

A cgp-tests build script now turns the example in each error backend's README into the module the readme_*.rs tests include, so the README is the only copy of its example.

Also update AGENTS.md's toolchain note to the pinned 1.98.1.

…s in place

`CanRaiseError::raise_error` and `CanWrapError::wrap_error` are now
`#[track_caller]`. `#[cgp_component]` copies the attribute onto the
provider trait's declaration, and Rust applies it to every impl,
including the generated forwarding impls, so an error library that
records `Location::caller()` sees the line that called `raise_error`.
`cgp-error-eyre` turns eyre's `track-caller` feature back on, and a new
`eyre_location` test checks the location through plain, `open`, and
namespace-path wiring, for each eyre raiser and for `RaiseFrom`.

A `cgp-tests` build script now turns the example in each error backend's
README into the module the `readme_*.rs` tests include, so the README is
the only copy of its example.

Also update AGENTS.md's toolchain note to the pinned 1.98.1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@soareschen
soareschen merged commit 367f066 into main Sep 26, 2026
3 checks passed
@soareschen
soareschen deleted the eyre-tracking branch September 26, 2026 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant