Record the caller's location in eyre reports, and test README examples in place - #270
Merged
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CanRaiseError::raise_errorandCanWrapError::wrap_errorare 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 recordsLocation::caller()sees the line that calledraise_error.cgp-error-eyreturns eyre'strack-callerfeature back on, and a neweyre_locationtest checks the location through plain,open, and namespace-path wiring, for each eyre raiser and forRaiseFrom.A
cgp-testsbuild script now turns the example in each error backend's README into the module thereadme_*.rstests include, so the README is the only copy of its example.Also update AGENTS.md's toolchain note to the pinned 1.98.1.