Merge remote-tracking branch 'upstream/main' into rust/dependency-renaming

This commit is contained in:
Tom Hvitved
2025-03-20 11:45:03 +01:00
156 changed files with 2118 additions and 1932 deletions

View File

@@ -406,20 +406,20 @@ class _:
"""
@annotate(RecordExprField)
@annotate(StructExprField)
class _:
"""
A field in a record expression. For example `a: 1` in:
A field in a struct expression. For example `a: 1` in:
```rust
Foo { a: 1, b: 2 };
```
"""
@annotate(RecordExpr, add_bases=(PathAstNode,), cfg=True)
@annotate(StructExpr, add_bases=(PathAstNode,), cfg=True)
class _:
"""
A record expression. For example:
A struct expression. For example:
```rust
let first = Foo { a: 1, b: 2 };
let second = Foo { a: 2, ..first };
@@ -710,20 +710,20 @@ class _:
"""
@annotate(RecordPatField)
@annotate(StructPatField)
class _:
"""
A field in a record pattern. For example `a: 1` in:
A field in a struct pattern. For example `a: 1` in:
```rust
let Foo { a: 1, b: 2 } = foo;
```
"""
@annotate(RecordPat, add_bases=(PathAstNode,), cfg=True)
@annotate(StructPat, add_bases=(PathAstNode,), cfg=True)
class _:
"""
A record pattern. For example:
A struct pattern. For example:
```rust
match x {
Foo { a: 1, b: 2 } => "ok",
@@ -1031,10 +1031,11 @@ class _:
"""
# @annotate(VariantFieldList)
@annotate(FieldList)
class _:
"""
A FieldList. For example:
A field of a variant. For example:
```rust
todo!()
```
@@ -1464,20 +1465,20 @@ class _:
"""
@annotate(RecordExprFieldList)
@annotate(StructExprFieldList)
class _:
"""
A RecordExprFieldList. For example:
A StructExprFieldList. For example:
```rust
todo!()
```
"""
@annotate(RecordField)
@annotate(StructField)
class _:
"""
A RecordField. For example:
A StructField. For example:
```rust
todo!()
```
@@ -1487,17 +1488,17 @@ class _:
@annotate(RecordFieldList)
class _:
"""
A RecordFieldList. For example:
A field list of a struct expression. For example:
```rust
todo!()
```
"""
@annotate(RecordPatFieldList)
@annotate(StructPatFieldList)
class _:
"""
A RecordPatFieldList. For example:
A StructPatFieldList. For example:
```rust
todo!()
```

26
rust/schema/ast.py generated
View File

@@ -519,21 +519,21 @@ class RangePat(Pat, ):
operator_name: optional[string]
start: optional["Pat"] | child
class RecordExpr(Expr, ):
class StructExpr(Expr, ):
path: optional["Path"] | child
record_expr_field_list: optional["RecordExprFieldList"] | child
struct_expr_field_list: optional["StructExprFieldList"] | child
class RecordExprField(AstNode, ):
class StructExprField(AstNode, ):
attrs: list["Attr"] | child
expr: optional["Expr"] | child
name_ref: optional["NameRef"] | child
class RecordExprFieldList(AstNode, ):
class StructExprFieldList(AstNode, ):
attrs: list["Attr"] | child
fields: list["RecordExprField"] | child
fields: list["StructExprField"] | child
spread: optional["Expr"] | child
class RecordField(AstNode, ):
class StructField(AstNode, ):
attrs: list["Attr"] | child
expr: optional["Expr"] | child
name: optional["Name"] | child
@@ -541,19 +541,19 @@ class RecordField(AstNode, ):
visibility: optional["Visibility"] | child
class RecordFieldList(FieldList, ):
fields: list["RecordField"] | child
fields: list["StructField"] | child
class RecordPat(Pat, ):
class StructPat(Pat, ):
path: optional["Path"] | child
record_pat_field_list: optional["RecordPatFieldList"] | child
struct_pat_field_list: optional["StructPatFieldList"] | child
class RecordPatField(AstNode, ):
class StructPatField(AstNode, ):
attrs: list["Attr"] | child
name_ref: optional["NameRef"] | child
pat: optional["Pat"] | child
class RecordPatFieldList(AstNode, ):
fields: list["RecordPatField"] | child
class StructPatFieldList(AstNode, ):
fields: list["StructPatField"] | child
rest_pat: optional["RestPat"] | child
class RefExpr(Expr, ):
@@ -713,7 +713,7 @@ class Union(Item, ):
attrs: list["Attr"] | child
generic_param_list: optional["GenericParamList"] | child
name: optional["Name"] | child
record_field_list: optional["RecordFieldList"] | child
struct_field_list: optional["RecordFieldList"] | child
visibility: optional["Visibility"] | child
where_clause: optional["WhereClause"] | child