rust/tests/ui/mir/mir-inlining/always-encode-mirs.rs
Tomasz Miąsko fe3cd2d194 Fix inlining with -Zalways-encode-mir
Only inline functions that are considered eligible for inlining
by the reachability pass.

This constraint was previously indirectly enforced by only exporting MIR
of eligible functions, but that approach doesn't work with
-Zalways-encode-mir enabled.
2023-08-27 23:52:27 +02:00

13 lines
358 B
Rust

// Regression test for MIR inlining with -Zalways-encode-mir enabled in the auxiliary crate.
// Previously we inlined function not eligible for inlining which lead to linking error:
// undefined reference to `internal::S'
//
// aux-build:internal.rs
// build-pass
// compile-flags: -O
extern crate internal;
fn main() {
println!("{}", internal::f());
}