Stream: project-error-handling

Topic: Iterator API for Backtrace


view this post on Zulip Sean Chen (he/him) (Oct 08 2020 at 23:57):

Hey @Ashley Mannix, if we want to get the ball rolling on implementing an iterator API for the Backtrace type, what would the first steps be for that? :smile:

view this post on Zulip Ashley Mannix (Oct 12 2020 at 17:59):

Hey @Sean Chen! Sorry for the late reply :blush: I was on leave last week. Are you talking about an iterator over the frames in the backtrace itself?

view this post on Zulip Jane Lusby (Oct 12 2020 at 18:00):

yes

view this post on Zulip Sean Chen (he/him) (Oct 22 2020 at 15:33):

Following up on this task. From last week’s meeting we mentioned that we could look into simply re-exporting the frames method from the backtrace crate into std. Apologies if this is a bit of an obtuse question, but how should we go about getting the ball rolling on this? 🙂

view this post on Zulip Sean Chen (he/him) (Oct 22 2020 at 15:34):

In the minutes doc from the last meeting we wrote down “Add it as an unstable API to Backtrace without an RFC to start with (just an FCP on the implementation itself)”. I’m not sure what an FCP is or how to get one started.

view this post on Zulip Jane Lusby (Oct 22 2020 at 15:46):

I think you just need to open a PR

view this post on Zulip Jane Lusby (Oct 22 2020 at 15:46):

and then the FCP is something that a libs team member triggers on the PR

view this post on Zulip Jane Lusby (Oct 22 2020 at 15:47):

@Ashley Mannix correct me if I'm wrong

view this post on Zulip Sean Chen (he/him) (Oct 22 2020 at 15:53):

Would that be a PR in std or in the Backtrace crate?

view this post on Zulip Ashley Mannix (Oct 23 2020 at 03:52):

Sorry! Just catching up on things :bow: Yep! Like @Jane Lusby mentioned, we'd do a PR to rust-lang/rust's Backtrace type with an API that looked something like this (pseudo attributes because I never remember the exact syntax off the top of my head):

// This type already exists, but is private
#[unstable(feature = "backtrace_frames")]
pub struct BacktraceFame;

impl Backtrace {
    // This is a new method. We'll have some semantics to work out (do we return `&[]` when the backtrace is unsupported? Or make it `Option`)?
    #[unstable(feature = "backtrace_frames")]
    pub fn frames(&self) -> &[BacktraceFrame];
}

view this post on Zulip Ashley Mannix (Oct 23 2020 at 03:53):

Feel free to open the PR up early @Sean Chen if you like and add a r? @KodrAus comment so it'll assign me and we can work through anything that comes up :smile:

view this post on Zulip Ashley Mannix (Oct 23 2020 at 03:54):

Or just drop a link and I'll assign myself to it :grinning_face_with_smiling_eyes:

view this post on Zulip Sean Chen (he/him) (Oct 23 2020 at 13:50):

Thanks for the pointers! :smile:


Last updated: Jan 26 2022 at 08:02 UTC