rust/tests/mir-opt/inline/issue_78442.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

21 lines
517 B
Rust
Raw Normal View History

// compile-flags: -Z mir-opt-level=3 -Z inline-mir
2021-10-17 08:49:26 -05:00
// ignore-wasm32-bare compiled with panic=abort by default
#![crate_type = "lib"]
// EMIT_MIR issue_78442.bar.RevealAll.diff
// EMIT_MIR issue_78442.bar.Inline.diff
pub fn bar<P>(
// Error won't happen if "bar" is not generic
_baz: P,
) {
hide_foo()();
}
fn hide_foo() -> impl Fn() {
// Error won't happen if "iterate" hasn't impl Trait or has generics
foo
}
fn foo() { // Error won't happen if "foo" isn't used in "iterate" or has generics
}