Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

consider using/copying backtrace-ext to more properly filter the backtrace

Aperta
#101 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
42/100
Tipo di issue
Refactoring
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
rust
Ambito
tooling

Direzione di ricerca

Inizia in src/report.rs nelle due sezioni con lo skipping dei frame codificate in modo rigido e collegate nell’issue, quindi confronta il loro comportamento con backtrace_ext::short_frames_strict. Verifica le implicazioni sulle dipendenze e sull’MSRV descritte nell’issue; il lavoro è completo quando il filtraggio fragile viene sostituito dal comportamento proposto e viene verificato che il report di panic mostri ancora lo stack previsto.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

human-panic currently skips a hardcoded number of frames which is... not what you want to do:

https://github.com/rust-cli/human-panic/blob/c0e52f47213eebfb3212f8029ff5705fd0e0c091/src/report.rs#L47-L52
https://github.com/rust-cli/human-panic/blob/c0e52f47213eebfb3212f8029ff5705fd0e0c091/src/report.rs#L66-L71

Rust emits two magic frame names to delimit the "runtime glue" from the "real stack". Unfortunately the backtrace crate doesn't support handling that for you. As such I made backtrace-ext::short_frames_strict to do that for everyone who is implementing this kind of logic.

The example is basically already human-panic's impl because I found this problem in miette which copied your impl. I can do the PR for you but I wasn't sure if you were ok with adding this dep (it's basically one complicated function but slightly factored out so I could unit test the crap out of it because you should never trust backtraces to provide decent input).

(NB: at the time of filing this issue I've published 0.2.0 but docs.rs is super backlogged. 0.2.0 includes fixes from me adding all the comprehensive tests, and also removes the "re-export of all of Backtrace" because I realized it's goody. If you see this issue soon enough just know that this line in the example changed to import Backtrace from backtrace and not backtrace-ext.)
(0.2.0 is live now, also I cut 0.2.1 to lower the msrv)

Lingua principale
Rust
Stelle
1.9k
Fork
65
Merge medio
2h 48m
PR unite (30g)
3

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di rust-cli/human-panic

Tutte le issue di rust-cli/human-panic

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.