Implement .use keyword as an alias of clone

This commit is contained in:
Santiago Pastorino
2024-10-02 16:35:37 -03:00
parent 0cf8dbc96c
commit 05c516446a
36 changed files with 247 additions and 24 deletions

View File

@@ -1399,6 +1399,7 @@ impl Expr {
// Never need parens
ExprKind::Array(_)
| ExprKind::Await(..)
| ExprKind::Use(..)
| ExprKind::Block(..)
| ExprKind::Call(..)
| ExprKind::ConstBlock(_)
@@ -1588,6 +1589,8 @@ pub enum ExprKind {
Gen(CaptureBy, P<Block>, GenBlockKind, Span),
/// An await expression (`my_future.await`). Span is of await keyword.
Await(P<Expr>, Span),
/// A use expression (`x.use`). Span is of use keyword.
Use(P<Expr>, Span),
/// A try block (`try { ... }`).
TryBlock(P<Block>),