Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 4729728

Browse files
committed
Auto merge of rust-lang#117192 - saethlin:leaves-can-assert, r=<try>
Don't treat asserts as a call in cross-crate inlining r? `@ghost`
2 parents ab5c841 + 242d47d commit 4729728

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

compiler/rustc_mir_transform/src/cross_crate_inline.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ impl<'tcx> Visitor<'tcx> for CostChecker<'_, 'tcx> {
100100
}
101101
}
102102
TerminatorKind::Assert { unwind, .. } => {
103-
self.calls += 1;
104103
if let UnwindAction::Cleanup(_) = unwind {
105104
self.landing_pads += 1;
106105
}

tests/codegen-units/item-collection/implicit-panic-call.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@ impl Div for i32 {
4848
}
4949

5050
#[allow(unconditional_panic)]
51+
#[inline(never)]
5152
pub fn foo() {
5253
// This implicitly generates a panic call.
5354
let _ = 1 / 0;
5455
}
5556

5657
//~ MONO_ITEM fn foo
57-
//~ MONO_ITEM fn <i32 as Div>::div
5858
//~ MONO_ITEM fn panic

0 commit comments

Comments
 (0)