@@ -18,6 +18,9 @@ impl<'tcx, 'body> ParseCtxt<'tcx, 'body> {
1818 @call( "mir_storage_dead" , args) => {
1919 Ok ( StatementKind :: StorageDead ( self . parse_local( args[ 0 ] ) ?) )
2020 } ,
21+ @call( "mir_deinit" , args) => {
22+ Ok ( StatementKind :: Deinit ( Box :: new( self . parse_place( args[ 0 ] ) ?) ) )
23+ } ,
2124 @call( "mir_retag" , args) => {
2225 Ok ( StatementKind :: Retag ( RetagKind :: Default , Box :: new( self . parse_place( args[ 0 ] ) ?) ) )
2326 } ,
@@ -141,6 +144,14 @@ impl<'tcx, 'body> ParseCtxt<'tcx, 'body> {
141144 fn parse_rvalue ( & self , expr_id : ExprId ) -> PResult < Rvalue < ' tcx > > {
142145 parse_by_kind ! ( self , expr_id, _, "rvalue" ,
143146 @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 ] ) ?) ) ,
144155 ExprKind :: Borrow { borrow_kind, arg } => Ok (
145156 Rvalue :: Ref ( self . tcx. lifetimes. re_erased, * borrow_kind, self . parse_place( * arg) ?)
146157 ) ,
@@ -153,6 +164,9 @@ impl<'tcx, 'body> ParseCtxt<'tcx, 'body> {
153164 ExprKind :: Unary { op, arg } => Ok (
154165 Rvalue :: UnaryOp ( * op, self . parse_operand( * arg) ?)
155166 ) ,
167+ ExprKind :: Repeat { value, count } => Ok (
168+ Rvalue :: Repeat ( self . parse_operand( * value) ?, * count)
169+ ) ,
156170 _ => self . parse_operand( expr_id) . map( Rvalue :: Use ) ,
157171 )
158172 }
0 commit comments