Files
rust/tests/mir-opt/inline/forced_inherent_dead_code.rs
Reuben Cruise 5bf5e71160 Extends rustc_force_inline to inherent methods
- Changes parser to allow application to inherent methods.
- Adds tests to confirm extended functionality works just as the existing.
2025-10-02 11:30:11 +01:00

22 lines
408 B
Rust

// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
//@ compile-flags: -Copt-level=0 -Clink-dead-code
#![feature(rustc_attrs)]
struct Foo {}
impl Foo {
#[rustc_force_inline]
pub fn callee_forced() {}
}
// EMIT_MIR forced_inherent_dead_code.caller.ForceInline.diff
pub fn caller() {
Foo::callee_forced();
// CHECK-LABEL: fn caller(
// CHECK: (inlined Foo::callee_forced)
}
fn main() {
caller();
}