]> git.proxmox.com Git - rustc.git/blob - src/test/mir-opt/inline/issue-78442.rs
New upstream version 1.66.0+dfsg1
[rustc.git] / src / test / mir-opt / inline / issue-78442.rs
1 // compile-flags: -Z mir-opt-level=3 -Z inline-mir
2 // ignore-wasm32-bare compiled with panic=abort by default
3 #![crate_type = "lib"]
4
5 // EMIT_MIR issue_78442.bar.RevealAll.diff
6 // EMIT_MIR issue_78442.bar.Inline.diff
7 pub fn bar<P>(
8 // Error won't happen if "bar" is not generic
9 _baz: P,
10 ) {
11 hide_foo()();
12 }
13
14 fn hide_foo() -> impl Fn() {
15 // Error won't happen if "iterate" hasn't impl Trait or has generics
16 foo
17 }
18
19 fn foo() { // Error won't happen if "foo" isn't used in "iterate" or has generics
20 }