restore emplacement syntax (obsolete)
This commit is contained in:
parent
07465222ca
commit
01d6ed525f
11 changed files with 97 additions and 6 deletions
|
@ -2839,6 +2839,17 @@ impl<'a> Parser<'a> {
|
|||
let (span, e) = self.interpolated_or_expr_span(e)?;
|
||||
(lo.to(span), ExprKind::AddrOf(m, e))
|
||||
}
|
||||
token::Ident(..) if self.token.is_keyword(keywords::In) => {
|
||||
self.bump();
|
||||
let place = self.parse_expr_res(
|
||||
Restrictions::NO_STRUCT_LITERAL,
|
||||
None,
|
||||
)?;
|
||||
let blk = self.parse_block()?;
|
||||
let span = blk.span;
|
||||
let blk_expr = self.mk_expr(span, ExprKind::Block(blk, None), ThinVec::new());
|
||||
(lo.to(span), ExprKind::ObsoleteInPlace(place, blk_expr))
|
||||
}
|
||||
token::Ident(..) if self.token.is_keyword(keywords::Box) => {
|
||||
self.bump();
|
||||
let e = self.parse_prefix_expr(None);
|
||||
|
@ -3042,6 +3053,8 @@ impl<'a> Parser<'a> {
|
|||
}
|
||||
AssocOp::Assign =>
|
||||
self.mk_expr(span, ExprKind::Assign(lhs, rhs), ThinVec::new()),
|
||||
AssocOp::ObsoleteInPlace =>
|
||||
self.mk_expr(span, ExprKind::ObsoleteInPlace(lhs, rhs), ThinVec::new()),
|
||||
AssocOp::AssignOp(k) => {
|
||||
let aop = match k {
|
||||
token::Plus => BinOpKind::Add,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue