custom MIR: add support for tail calls · model-checking/verify-rust-std@9cc3bc6 (original) (raw)
`@@ -247,6 +247,8 @@
`
247
247
`//! otherwise branch.
`
248
248
`` //! - [Call
] has an associated function as well, with special syntax:
``
249
249
`` //! Call(ret_val = function(arg1, arg2, ...), ReturnTo(next_block), UnwindContinue())
.
``
``
250
`` +
//! - [TailCall
] does not have a return destination or next block, so its syntax is just
``
``
251
`` +
//! TailCall(function(arg1, arg2, ...))
.
``
250
252
``
251
253
`#![unstable(
`
252
254
` feature = "custom_mir",
`
`@@ -350,6 +352,12 @@ define!("mir_call",
`
350
352
`` /// - [UnwindCleanup
]
``
351
353
`fn Call(call: (), goto: ReturnToArg, unwind_action: UnwindActionArg)
`
352
354
`);
`
``
355
`+
define!("mir_tail_call",
`
``
356
`+
/// Call a function.
`
``
357
`+
///
`
``
358
`` +
/// The argument must be of the form fun(arg1, arg2, ...)
.
``
``
359
`+
fn TailCall(call: T)
`
``
360
`+
);
`
353
361
`define!("mir_unwind_resume",
`
354
362
`/// A terminator that resumes the unwinding.
`
355
363
`fn UnwindResume()
`