feat: add #[track_caller] to functions that panic #748
Merged
starovoid merged 1 commit intopetgraph:masterfrom Apr 7, 2025
Merged
feat: add #[track_caller] to functions that panic #748starovoid merged 1 commit intopetgraph:masterfrom
#[track_caller] to functions that panic #748starovoid merged 1 commit intopetgraph:masterfrom
Conversation
798ce5f to
c705e61
Compare
Contributor
Author
|
Oops, I think I found an undocumented panic, turning into draft for now while I figure out what's going on. |
c705e61 to
de069a5
Compare
Contributor
Author
|
Done, I documented more panics. Now I'm get this panic message: I also changed wording around |
#[track_caller] to functions that panic#[track_caller] to functions that panic
#[track_caller] to functions that panic#[track_caller] to functions that panic
edec862 to
76eb2a9
Compare
Contributor
Author
|
@ABorgna ping, I solved the conflicts. |
Collaborator
|
Hi, nice feature! Plan to include it in the next minor release |
76eb2a9 to
3e0b4bd
Compare
Merged
github-merge-queue bot
pushed a commit
that referenced
this pull request
Apr 7, 2025
## 🤖 New release * `petgraph`: 0.8.0 -> 0.8.1 (✓ API compatible changes) <details><summary><i><b>Changelog</b></i></summary><p> <blockquote> ## [0.8.1](https://github.com/petgraph/petgraph/compare/[email protected]@v0.8.1) - 2025-04-07 ### Bug Fixes - Bring back `VisitMap` impl for std `HashSet` ([#764](#764)) ### New Features - Add `UnionFind` capacity management methods ([#736](#736)) - add `#[track_caller]` to functions that panic ([#748](#748)) </blockquote> </p></details> --- This PR was generated with [release-plz](https://github.com/release-plz/release-plz/). --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Agustín Borgna <[email protected]>
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.
While using
AcyclicI got this panic:While expected, it'd be more helpful if it pointed to the caller in my code, not the upstream code.
I started adding
#[track_caller]forAcyclicand ended up going through all functions that contain "panics" in their docs, except forstd::ops::Index[Mut]cause those have#[track_caller]in the trait definition.