2023-10-16 17:36:39 +00:00
|
|
|
// skip-filecheck
|
2024-02-22 12:10:29 +00:00
|
|
|
//@ compile-flags: -Zmir-opt-level=0
|
2020-06-15 20:54:40 +02:00
|
|
|
|
|
|
|
// Tests that the `<fn() as Fn>` shim does not create a `Call` terminator with a `Self` callee
|
|
|
|
// (as only `FnDef` and `FnPtr` callees are allowed in MIR).
|
|
|
|
|
2020-07-27 21:22:43 +02:00
|
|
|
// EMIT_MIR core.ops-function-Fn-call.AddMovesForPackedDrops.before.mir
|
2024-01-30 22:28:28 -05:00
|
|
|
pub fn main() {
|
2020-06-15 20:54:40 +02:00
|
|
|
call(noop as fn());
|
|
|
|
}
|
|
|
|
|
|
|
|
fn noop() {}
|
|
|
|
|
|
|
|
fn call<F: Fn()>(f: F) {
|
|
|
|
f();
|
|
|
|
}
|