@@ -18,6 +18,9 @@ impl<'tcx, 'body> ParseCtxt<'tcx, 'body> {
18
18
@call( "mir_storage_dead" , args) => {
19
19
Ok ( StatementKind :: StorageDead ( self . parse_local( args[ 0 ] ) ?) )
20
20
} ,
21
+ @call( "mir_deinit" , args) => {
22
+ Ok ( StatementKind :: Deinit ( Box :: new( self . parse_place( args[ 0 ] ) ?) ) )
23
+ } ,
21
24
@call( "mir_retag" , args) => {
22
25
Ok ( StatementKind :: Retag ( RetagKind :: Default , Box :: new( self . parse_place( args[ 0 ] ) ?) ) )
23
26
} ,
@@ -141,6 +144,14 @@ impl<'tcx, 'body> ParseCtxt<'tcx, 'body> {
141
144
fn parse_rvalue ( & self , expr_id : ExprId ) -> PResult < Rvalue < ' tcx > > {
142
145
parse_by_kind ! ( self , expr_id, _, "rvalue" ,
143
146
@call( "mir_discriminant" , args) => self . parse_place( args[ 0 ] ) . map( Rvalue :: Discriminant ) ,
147
+ @call( "mir_checked" , args) => {
148
+ parse_by_kind!( self , args[ 0 ] , _, "binary op" ,
149
+ ExprKind :: Binary { op, lhs, rhs } => Ok ( Rvalue :: CheckedBinaryOp (
150
+ * op, Box :: new( ( self . parse_operand( * lhs) ?, self . parse_operand( * rhs) ?) )
151
+ ) ) ,
152
+ )
153
+ } ,
154
+ @call( "mir_len" , args) => Ok ( Rvalue :: Len ( self . parse_place( args[ 0 ] ) ?) ) ,
144
155
ExprKind :: Borrow { borrow_kind, arg } => Ok (
145
156
Rvalue :: Ref ( self . tcx. lifetimes. re_erased, * borrow_kind, self . parse_place( * arg) ?)
146
157
) ,
@@ -153,6 +164,9 @@ impl<'tcx, 'body> ParseCtxt<'tcx, 'body> {
153
164
ExprKind :: Unary { op, arg } => Ok (
154
165
Rvalue :: UnaryOp ( * op, self . parse_operand( * arg) ?)
155
166
) ,
167
+ ExprKind :: Repeat { value, count } => Ok (
168
+ Rvalue :: Repeat ( self . parse_operand( * value) ?, * count)
169
+ ) ,
156
170
_ => self . parse_operand( expr_id) . map( Rvalue :: Use ) ,
157
171
)
158
172
}
0 commit comments