Stream: project-error-handling

Topic: panic::Location module_path


view this post on Zulip jplatte (Sep 13 2021 at 12:43):

Hi! Without knowing much about the internals of #[track_caller] and std::panic::Location, I'm wonder whether it would be possible to add a module_path() method to it.

view this post on Zulip jplatte (Sep 13 2021 at 12:44):

I'd like to replace some macros that log errors with regular functions that use #[track_caller] to capture the "original" error location, but currently I can't properly do that because panic::Location doesn't offer an equivalent to the macro std::module_path!()

view this post on Zulip jplatte (Sep 13 2021 at 12:45):

I couldn't find an existing issue about this in rust-lang/rust and figured here might be the best place to ask. If it's not, please let me know.

view this post on Zulip Jane Lusby (Sep 13 2021 at 17:48):

This probably isn't the right place to ask, I'd assume that's a compiler team question, but it sounds like a good idea to me

view this post on Zulip Charles Ellis O'Riley Jr. (Sep 13 2021 at 19:21):

Concentrate on your prep work Jane. See you next week.


Last updated: Jan 26 2022 at 14:20 UTC