Skip to content

Commit 30cc96e

Browse files
authored
Rollup merge of rust-lang#88860 - nbdd0121:panic, r=m-ou-se
Deduplicate panic_fmt std's begin_panic_fmt and core's panic_fmt are duplicates. Merge them to declutter code and remove a lang item.
2 parents e84537b + ebf4f03 commit 30cc96e

File tree

3 files changed

+0
-3
lines changed

3 files changed

+0
-3
lines changed

clippy_utils/src/higher.rs

-1
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,6 @@ impl PanicExpn<'tcx> {
619619
if let Some(init) = block.expr;
620620
if let ExprKind::Call(_, [format_args]) = init.kind;
621621
let expn_data = expr.span.ctxt().outer_expn_data();
622-
if let ExprKind::AddrOf(_, _, format_args) = format_args.kind;
623622
if let Some(format_args) = FormatArgsExpn::parse(format_args);
624623
then {
625624
Some(PanicExpn {

clippy_utils/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1646,7 +1646,6 @@ pub fn match_panic_def_id(cx: &LateContext<'_>, did: DefId) -> bool {
16461646
did,
16471647
&[
16481648
&paths::BEGIN_PANIC,
1649-
&paths::BEGIN_PANIC_FMT,
16501649
&paths::PANIC_ANY,
16511650
&paths::PANICKING_PANIC,
16521651
&paths::PANICKING_PANIC_FMT,

clippy_utils/src/paths.rs

-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ pub const ARC_PTR_EQ: [&str; 4] = ["alloc", "sync", "Arc", "ptr_eq"];
2020
pub const ASMUT_TRAIT: [&str; 3] = ["core", "convert", "AsMut"];
2121
pub const ASREF_TRAIT: [&str; 3] = ["core", "convert", "AsRef"];
2222
pub(super) const BEGIN_PANIC: [&str; 3] = ["std", "panicking", "begin_panic"];
23-
pub(super) const BEGIN_PANIC_FMT: [&str; 3] = ["std", "panicking", "begin_panic_fmt"];
2423
/// Preferably use the diagnostic item `sym::Borrow` where possible
2524
pub const BORROW_TRAIT: [&str; 3] = ["core", "borrow", "Borrow"];
2625
pub const BTREEMAP_CONTAINS_KEY: [&str; 6] = ["alloc", "collections", "btree", "map", "BTreeMap", "contains_key"];

0 commit comments

Comments
 (0)