2
Handle panicking like rustc CTFE does by Nilstrieb · Pull Request #16935 · rust-...
source link: https://github.com/rust-lang/rust-analyzer/pull/16935
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Conversation
Member
Instead of using core::fmt::format
to format panic messages, which may in turn panic too and cause recursive panics and other messy things, redirect panic_fmt
to const_panic_fmt
like CTFE, which in turn goes to panic_display
and does the things normally. See the tests for the full call stack.
The tests don't work yet, I probably missed something in minicore.
fixes #16907 in my local testing, I also need to add a test for it
kornelski and roife reacted with thumbs up emojiHKalbasi and DrewMcArthur reacted with heart emoji
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK