rust/tests/ui/mir/mir-inlining/auxiliary/internal.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

8 lines
102 B
Rust

// compile-flags: -Zalways-encode-mir
static S: usize = 42;
pub fn f() -> &'static usize {
&S
}