Skip to content

error-stack remove special casing of Location for formatting #1237

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 21 commits into from
Oct 24, 2022

Conversation

indietyp
Copy link
Member

@indietyp indietyp commented Oct 21, 2022

🌟 What is the purpose of this PR?

This removes the special casing currently used to display the source location of a Context.

🔗 Related links

🔍 What does this change?

  • convert Location logic into hook
  • remove dead-code (removal of Instruction::Symbol variant)
  • provide location for frames on nightly via Provide API (reverted in 38dbd4e)
  • new FrameType and AttachmentType, which act as marker equivalents to FrameKind and AttachmentKind respectively (reverted in 38dbd4e)

📜 Does this require a change to the docs?

No, as this special casing was never explained to the user.

We may want to add docs about nightly provide API vs. stable downcast.

🛡 What tests cover this?

The existing tests should not fail.

📋 ToDo

  • test to remove Location hook.

This time I remembered to add a changelog entry, let's gooooooo

@github-actions github-actions bot added the area/libs > error-stack Affects the `error-stack` crate (library) label Oct 21, 2022
`Location` is now only special cased in `fmt`, like it was before, but now one can set hooks.
Copy link
Member

@TimDiekmann TimDiekmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few minor documentation changes, but otherwise looks great, thank you!

@indietyp indietyp requested a review from TimDiekmann October 24, 2022 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/libs > error-stack Affects the `error-stack` crate (library)
Development

Successfully merging this pull request may close these issues.

2 participants