File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
library/core/src/intrinsics Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change 4949//!
5050//! The input to the [`mir!`] macro is:
5151//!
52+ //! - An optional return type annotation in the form of `type RET = ...;`. This may be required
53+ //! if the compiler cannot infer the type of RET.
5254//! - A possibly empty list of local declarations. Locals can also be declared inline on
5355//! assignments via `let`. Type inference generally works. Shadowing does not.
5456//! - A list of basic blocks. The first of these is the start block and is where execution begins.
124126//! }
125127//! )
126128//! }
129+ //!
130+ //! #[custom_mir(dialect = "runtime", phase = "optimized")]
131+ //! fn annotated_return_type() -> (i32, bool) {
132+ //! mir!(
133+ //! type RET = (i32, bool);
134+ //! {
135+ //! RET.0 = 1;
136+ //! RET.1 = true;
137+ //! Return()
138+ //! }
139+ //! )
140+ //! }
127141//! ```
128142//!
129143//! We can also set off compilation failures that happen in sufficiently late stages of the
You can’t perform that action at this time.
0 commit comments