File tree 1 file changed +14
-0
lines changed
library/core/src/intrinsics
1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change 49
49
//!
50
50
//! The input to the [`mir!`] macro is:
51
51
//!
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.
52
54
//! - A possibly empty list of local declarations. Locals can also be declared inline on
53
55
//! assignments via `let`. Type inference generally works. Shadowing does not.
54
56
//! - A list of basic blocks. The first of these is the start block and is where execution begins.
124
126
//! }
125
127
//! )
126
128
//! }
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
+ //! }
127
141
//! ```
128
142
//!
129
143
//! 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