Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename PanicInfo to PanicHookInfo #6865

Merged
merged 2 commits into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions prdoc/pr_6865.prdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
title: Rename PanicInfo to PanicHookInfo
doc:
- audience: Node Dev
description: Starting with Rust 1.82 `PanicInfo` is deprecated and will throw warnings
when used. The new type is available since Rust 1.81 and should be available on
our CI.
crates:
- name: sp-panic-handler
bump: patch
4 changes: 2 additions & 2 deletions substrate/primitives/panic-handler/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ use std::{
cell::Cell,
io::{self, Write},
marker::PhantomData,
panic::{self, PanicInfo},
panic::{self, PanicHookInfo},
sync::LazyLock,
thread,
};
Expand Down Expand Up @@ -149,7 +149,7 @@ fn strip_control_codes(input: &str) -> std::borrow::Cow<str> {
}

/// Function being called when a panic happens.
fn panic_hook(info: &PanicInfo, report_url: &str, version: &str) {
fn panic_hook(info: &PanicHookInfo, report_url: &str, version: &str) {
let location = info.location();
let file = location.as_ref().map(|l| l.file()).unwrap_or("<unknown>");
let line = location.as_ref().map(|l| l.line()).unwrap_or(0);
Expand Down
Loading