2022-08-26 13:52:41 +10:00
|
|
|
ast-stats-1 PRE EXPANSION AST STATS
|
|
|
|
|
ast-stats-1 Name Accumulated Size Count Item Size
|
|
|
|
|
ast-stats-1 ----------------------------------------------------------------
|
2024-10-17 19:50:59 +02:00
|
|
|
ast-stats-1 Crate 40 ( 0.6%) 1 40
|
2022-11-23 11:55:16 +11:00
|
|
|
ast-stats-1 GenericArgs 40 ( 0.6%) 1 40
|
|
|
|
|
ast-stats-1 - AngleBracketed 40 ( 0.6%) 1
|
2022-11-22 09:17:20 +11:00
|
|
|
ast-stats-1 ExprField 48 ( 0.7%) 1 48
|
2023-01-30 14:58:23 +11:00
|
|
|
ast-stats-1 Attribute 64 ( 1.0%) 2 32
|
2022-11-22 16:23:25 +11:00
|
|
|
ast-stats-1 - DocComment 32 ( 0.5%) 1
|
2024-10-17 19:50:59 +02:00
|
|
|
ast-stats-1 - Normal 32 ( 0.5%) 1
|
2025-02-05 18:58:29 +08:00
|
|
|
ast-stats-1 WherePredicate 72 ( 1.1%) 1 72
|
|
|
|
|
ast-stats-1 - BoundPredicate 72 ( 1.1%) 1
|
Move `ast::Item::ident` into `ast::ItemKind`.
`ast::Item` has an `ident` field.
- It's always non-empty for these item kinds: `ExternCrate`, `Static`,
`Const`, `Fn`, `Mod`, `TyAlias`, `Enum`, `Struct`, `Union`,
`Trait`, `TraitAlias`, `MacroDef`, `Delegation`.
- It's always empty for these item kinds: `Use`, `ForeignMod`,
`GlobalAsm`, `Impl`, `MacCall`, `DelegationMac`.
There is a similar story for `AssocItemKind` and `ForeignItemKind`.
Some sites that handle items check for an empty ident, some don't. This
is a very C-like way of doing things, but this is Rust, we have sum
types, we can do this properly and never forget to check for the
exceptional case and never YOLO possibly empty identifiers (or possibly
dummy spans) around and hope that things will work out.
The commit is large but it's mostly obvious plumbing work. Some notable
things.
- `ast::Item` got 8 bytes bigger. This could be avoided by boxing the
fields within some of the `ast::ItemKind` variants (specifically:
`Struct`, `Union`, `Enum`). I might do that in a follow-up; this
commit is big enough already.
- For the visitors: `FnKind` no longer needs an `ident` field because
the `Fn` within how has one.
- In the parser, the `ItemInfo` typedef is no longer needed. It was used
in various places to return an `Ident` alongside an `ItemKind`, but
now the `Ident` (if present) is within the `ItemKind`.
- In a few places I renamed identifier variables called `name` (or
`foo_name`) as `ident` (or `foo_ident`), to better match the type, and
because `name` is normally used for `Symbol`s. It's confusing to see
something like `foo_name.name`.
2025-03-21 09:47:43 +11:00
|
|
|
ast-stats-1 ForeignItem 80 ( 1.2%) 1 80
|
|
|
|
|
ast-stats-1 - Fn 80 ( 1.2%) 1
|
Detect more cases of `=` to `:` typo
When a `Local` is fully parsed, but not followed by a `;`, keep the `:` span
arround and mention it. If the type could continue being parsed as an
expression, suggest replacing the `:` with a `=`.
```
error: expected one of `!`, `+`, `->`, `::`, `;`, or `=`, found `.`
--> file.rs:2:32
|
2 | let _: std::env::temp_dir().join("foo");
| - ^ expected one of `!`, `+`, `->`, `::`, `;`, or `=`
| |
| while parsing the type for `_`
| help: use `=` if you meant to assign
```
Fix #119665.
2024-02-27 00:48:32 +00:00
|
|
|
ast-stats-1 Local 80 ( 1.2%) 1 80
|
2024-06-26 15:25:57 +03:00
|
|
|
ast-stats-1 Arm 96 ( 1.4%) 2 48
|
2022-11-23 11:55:16 +11:00
|
|
|
ast-stats-1 FnDecl 120 ( 1.8%) 5 24
|
2024-10-17 19:50:59 +02:00
|
|
|
ast-stats-1 Param 160 ( 2.4%) 4 40
|
2023-12-20 15:22:06 +01:00
|
|
|
ast-stats-1 Stmt 160 ( 2.4%) 5 32
|
2024-03-14 12:00:46 +01:00
|
|
|
ast-stats-1 - Let 32 ( 0.5%) 1
|
2022-11-22 16:23:25 +11:00
|
|
|
ast-stats-1 - MacCall 32 ( 0.5%) 1
|
2024-06-26 15:25:57 +03:00
|
|
|
ast-stats-1 - Expr 96 ( 1.4%) 3
|
2023-11-24 14:32:05 +00:00
|
|
|
ast-stats-1 Block 192 ( 2.9%) 6 32
|
2024-08-24 17:22:48 +00:00
|
|
|
ast-stats-1 FieldDef 208 ( 3.1%) 2 104
|
2024-01-26 17:00:28 +00:00
|
|
|
ast-stats-1 Variant 208 ( 3.1%) 2 104
|
Move `ast::Item::ident` into `ast::ItemKind`.
`ast::Item` has an `ident` field.
- It's always non-empty for these item kinds: `ExternCrate`, `Static`,
`Const`, `Fn`, `Mod`, `TyAlias`, `Enum`, `Struct`, `Union`,
`Trait`, `TraitAlias`, `MacroDef`, `Delegation`.
- It's always empty for these item kinds: `Use`, `ForeignMod`,
`GlobalAsm`, `Impl`, `MacCall`, `DelegationMac`.
There is a similar story for `AssocItemKind` and `ForeignItemKind`.
Some sites that handle items check for an empty ident, some don't. This
is a very C-like way of doing things, but this is Rust, we have sum
types, we can do this properly and never forget to check for the
exceptional case and never YOLO possibly empty identifiers (or possibly
dummy spans) around and hope that things will work out.
The commit is large but it's mostly obvious plumbing work. Some notable
things.
- `ast::Item` got 8 bytes bigger. This could be avoided by boxing the
fields within some of the `ast::ItemKind` variants (specifically:
`Struct`, `Union`, `Enum`). I might do that in a follow-up; this
commit is big enough already.
- For the visitors: `FnKind` no longer needs an `ident` field because
the `Fn` within how has one.
- In the parser, the `ItemInfo` typedef is no longer needed. It was used
in various places to return an `Ident` alongside an `ItemKind`, but
now the `Ident` (if present) is within the `ItemKind`.
- In a few places I renamed identifier variables called `name` (or
`foo_name`) as `ident` (or `foo_ident`), to better match the type, and
because `name` is normally used for `Symbol`s. It's confusing to see
something like `foo_name.name`.
2025-03-21 09:47:43 +11:00
|
|
|
ast-stats-1 AssocItem 320 ( 4.8%) 4 80
|
|
|
|
|
ast-stats-1 - Fn 160 ( 2.4%) 2
|
|
|
|
|
ast-stats-1 - Type 160 ( 2.4%) 2
|
|
|
|
|
ast-stats-1 GenericBound 352 ( 5.2%) 4 88
|
|
|
|
|
ast-stats-1 - Trait 352 ( 5.2%) 4
|
|
|
|
|
ast-stats-1 GenericParam 480 ( 7.1%) 5 96
|
2024-08-24 17:22:48 +00:00
|
|
|
ast-stats-1 Pat 504 ( 7.5%) 7 72
|
2023-01-30 14:58:23 +11:00
|
|
|
ast-stats-1 - Struct 72 ( 1.1%) 1
|
|
|
|
|
ast-stats-1 - Wild 72 ( 1.1%) 1
|
Move `ast::Item::ident` into `ast::ItemKind`.
`ast::Item` has an `ident` field.
- It's always non-empty for these item kinds: `ExternCrate`, `Static`,
`Const`, `Fn`, `Mod`, `TyAlias`, `Enum`, `Struct`, `Union`,
`Trait`, `TraitAlias`, `MacroDef`, `Delegation`.
- It's always empty for these item kinds: `Use`, `ForeignMod`,
`GlobalAsm`, `Impl`, `MacCall`, `DelegationMac`.
There is a similar story for `AssocItemKind` and `ForeignItemKind`.
Some sites that handle items check for an empty ident, some don't. This
is a very C-like way of doing things, but this is Rust, we have sum
types, we can do this properly and never forget to check for the
exceptional case and never YOLO possibly empty identifiers (or possibly
dummy spans) around and hope that things will work out.
The commit is large but it's mostly obvious plumbing work. Some notable
things.
- `ast::Item` got 8 bytes bigger. This could be avoided by boxing the
fields within some of the `ast::ItemKind` variants (specifically:
`Struct`, `Union`, `Enum`). I might do that in a follow-up; this
commit is big enough already.
- For the visitors: `FnKind` no longer needs an `ident` field because
the `Fn` within how has one.
- In the parser, the `ItemInfo` typedef is no longer needed. It was used
in various places to return an `Ident` alongside an `ItemKind`, but
now the `Ident` (if present) is within the `ItemKind`.
- In a few places I renamed identifier variables called `name` (or
`foo_name`) as `ident` (or `foo_ident`), to better match the type, and
because `name` is normally used for `Symbol`s. It's confusing to see
something like `foo_name.name`.
2025-03-21 09:47:43 +11:00
|
|
|
ast-stats-1 - Ident 360 ( 5.3%) 5
|
2024-11-25 16:38:35 +08:00
|
|
|
ast-stats-1 Expr 576 ( 8.6%) 8 72
|
2022-11-23 11:55:16 +11:00
|
|
|
ast-stats-1 - Match 72 ( 1.1%) 1
|
2024-12-17 14:44:35 +11:00
|
|
|
ast-stats-1 - Path 72 ( 1.1%) 1
|
2022-11-23 11:55:16 +11:00
|
|
|
ast-stats-1 - Struct 72 ( 1.1%) 1
|
2025-02-05 18:58:29 +08:00
|
|
|
ast-stats-1 - Lit 144 ( 2.1%) 2
|
2024-10-27 01:35:33 +02:00
|
|
|
ast-stats-1 - Block 216 ( 3.2%) 3
|
Move `ast::Item::ident` into `ast::ItemKind`.
`ast::Item` has an `ident` field.
- It's always non-empty for these item kinds: `ExternCrate`, `Static`,
`Const`, `Fn`, `Mod`, `TyAlias`, `Enum`, `Struct`, `Union`,
`Trait`, `TraitAlias`, `MacroDef`, `Delegation`.
- It's always empty for these item kinds: `Use`, `ForeignMod`,
`GlobalAsm`, `Impl`, `MacCall`, `DelegationMac`.
There is a similar story for `AssocItemKind` and `ForeignItemKind`.
Some sites that handle items check for an empty ident, some don't. This
is a very C-like way of doing things, but this is Rust, we have sum
types, we can do this properly and never forget to check for the
exceptional case and never YOLO possibly empty identifiers (or possibly
dummy spans) around and hope that things will work out.
The commit is large but it's mostly obvious plumbing work. Some notable
things.
- `ast::Item` got 8 bytes bigger. This could be avoided by boxing the
fields within some of the `ast::ItemKind` variants (specifically:
`Struct`, `Union`, `Enum`). I might do that in a follow-up; this
commit is big enough already.
- For the visitors: `FnKind` no longer needs an `ident` field because
the `Fn` within how has one.
- In the parser, the `ItemInfo` typedef is no longer needed. It was used
in various places to return an `Ident` alongside an `ItemKind`, but
now the `Ident` (if present) is within the `ItemKind`.
- In a few places I renamed identifier variables called `name` (or
`foo_name`) as `ident` (or `foo_ident`), to better match the type, and
because `name` is normally used for `Symbol`s. It's confusing to see
something like `foo_name.name`.
2025-03-21 09:47:43 +11:00
|
|
|
ast-stats-1 PathSegment 744 (11.0%) 31 24
|
|
|
|
|
ast-stats-1 Ty 896 (13.3%) 14 64
|
2024-10-17 19:50:59 +02:00
|
|
|
ast-stats-1 - Ptr 64 ( 1.0%) 1
|
2024-12-17 14:44:35 +11:00
|
|
|
ast-stats-1 - Ref 64 ( 1.0%) 1
|
2024-01-26 17:00:28 +00:00
|
|
|
ast-stats-1 - ImplicitSelf 128 ( 1.9%) 2
|
2025-02-05 18:58:29 +08:00
|
|
|
ast-stats-1 - Path 640 ( 9.5%) 10
|
Move `ast::Item::ident` into `ast::ItemKind`.
`ast::Item` has an `ident` field.
- It's always non-empty for these item kinds: `ExternCrate`, `Static`,
`Const`, `Fn`, `Mod`, `TyAlias`, `Enum`, `Struct`, `Union`,
`Trait`, `TraitAlias`, `MacroDef`, `Delegation`.
- It's always empty for these item kinds: `Use`, `ForeignMod`,
`GlobalAsm`, `Impl`, `MacCall`, `DelegationMac`.
There is a similar story for `AssocItemKind` and `ForeignItemKind`.
Some sites that handle items check for an empty ident, some don't. This
is a very C-like way of doing things, but this is Rust, we have sum
types, we can do this properly and never forget to check for the
exceptional case and never YOLO possibly empty identifiers (or possibly
dummy spans) around and hope that things will work out.
The commit is large but it's mostly obvious plumbing work. Some notable
things.
- `ast::Item` got 8 bytes bigger. This could be avoided by boxing the
fields within some of the `ast::ItemKind` variants (specifically:
`Struct`, `Union`, `Enum`). I might do that in a follow-up; this
commit is big enough already.
- For the visitors: `FnKind` no longer needs an `ident` field because
the `Fn` within how has one.
- In the parser, the `ItemInfo` typedef is no longer needed. It was used
in various places to return an `Ident` alongside an `ItemKind`, but
now the `Ident` (if present) is within the `ItemKind`.
- In a few places I renamed identifier variables called `name` (or
`foo_name`) as `ident` (or `foo_ident`), to better match the type, and
because `name` is normally used for `Symbol`s. It's confusing to see
something like `foo_name.name`.
2025-03-21 09:47:43 +11:00
|
|
|
ast-stats-1 Item 1_296 (19.2%) 9 144
|
|
|
|
|
ast-stats-1 - Enum 144 ( 2.1%) 1
|
|
|
|
|
ast-stats-1 - ForeignMod 144 ( 2.1%) 1
|
|
|
|
|
ast-stats-1 - Impl 144 ( 2.1%) 1
|
|
|
|
|
ast-stats-1 - Trait 144 ( 2.1%) 1
|
|
|
|
|
ast-stats-1 - Fn 288 ( 4.3%) 2
|
|
|
|
|
ast-stats-1 - Use 432 ( 6.4%) 3
|
2022-08-26 13:52:41 +10:00
|
|
|
ast-stats-1 ----------------------------------------------------------------
|
Move `ast::Item::ident` into `ast::ItemKind`.
`ast::Item` has an `ident` field.
- It's always non-empty for these item kinds: `ExternCrate`, `Static`,
`Const`, `Fn`, `Mod`, `TyAlias`, `Enum`, `Struct`, `Union`,
`Trait`, `TraitAlias`, `MacroDef`, `Delegation`.
- It's always empty for these item kinds: `Use`, `ForeignMod`,
`GlobalAsm`, `Impl`, `MacCall`, `DelegationMac`.
There is a similar story for `AssocItemKind` and `ForeignItemKind`.
Some sites that handle items check for an empty ident, some don't. This
is a very C-like way of doing things, but this is Rust, we have sum
types, we can do this properly and never forget to check for the
exceptional case and never YOLO possibly empty identifiers (or possibly
dummy spans) around and hope that things will work out.
The commit is large but it's mostly obvious plumbing work. Some notable
things.
- `ast::Item` got 8 bytes bigger. This could be avoided by boxing the
fields within some of the `ast::ItemKind` variants (specifically:
`Struct`, `Union`, `Enum`). I might do that in a follow-up; this
commit is big enough already.
- For the visitors: `FnKind` no longer needs an `ident` field because
the `Fn` within how has one.
- In the parser, the `ItemInfo` typedef is no longer needed. It was used
in various places to return an `Ident` alongside an `ItemKind`, but
now the `Ident` (if present) is within the `ItemKind`.
- In a few places I renamed identifier variables called `name` (or
`foo_name`) as `ident` (or `foo_ident`), to better match the type, and
because `name` is normally used for `Symbol`s. It's confusing to see
something like `foo_name.name`.
2025-03-21 09:47:43 +11:00
|
|
|
ast-stats-1 Total 6_736 116
|
2022-08-26 13:52:41 +10:00
|
|
|
ast-stats-1
|
|
|
|
|
ast-stats-2 POST EXPANSION AST STATS
|
|
|
|
|
ast-stats-2 Name Accumulated Size Count Item Size
|
|
|
|
|
ast-stats-2 ----------------------------------------------------------------
|
2024-10-17 19:50:59 +02:00
|
|
|
ast-stats-2 Crate 40 ( 0.5%) 1 40
|
2024-06-26 15:25:57 +03:00
|
|
|
ast-stats-2 GenericArgs 40 ( 0.5%) 1 40
|
|
|
|
|
ast-stats-2 - AngleBracketed 40 ( 0.5%) 1
|
Move `ast::Item::ident` into `ast::ItemKind`.
`ast::Item` has an `ident` field.
- It's always non-empty for these item kinds: `ExternCrate`, `Static`,
`Const`, `Fn`, `Mod`, `TyAlias`, `Enum`, `Struct`, `Union`,
`Trait`, `TraitAlias`, `MacroDef`, `Delegation`.
- It's always empty for these item kinds: `Use`, `ForeignMod`,
`GlobalAsm`, `Impl`, `MacCall`, `DelegationMac`.
There is a similar story for `AssocItemKind` and `ForeignItemKind`.
Some sites that handle items check for an empty ident, some don't. This
is a very C-like way of doing things, but this is Rust, we have sum
types, we can do this properly and never forget to check for the
exceptional case and never YOLO possibly empty identifiers (or possibly
dummy spans) around and hope that things will work out.
The commit is large but it's mostly obvious plumbing work. Some notable
things.
- `ast::Item` got 8 bytes bigger. This could be avoided by boxing the
fields within some of the `ast::ItemKind` variants (specifically:
`Struct`, `Union`, `Enum`). I might do that in a follow-up; this
commit is big enough already.
- For the visitors: `FnKind` no longer needs an `ident` field because
the `Fn` within how has one.
- In the parser, the `ItemInfo` typedef is no longer needed. It was used
in various places to return an `Ident` alongside an `ItemKind`, but
now the `Ident` (if present) is within the `ItemKind`.
- In a few places I renamed identifier variables called `name` (or
`foo_name`) as `ident` (or `foo_ident`), to better match the type, and
because `name` is normally used for `Symbol`s. It's confusing to see
something like `foo_name.name`.
2025-03-21 09:47:43 +11:00
|
|
|
ast-stats-2 ExprField 48 ( 0.6%) 1 48
|
2025-02-05 18:58:29 +08:00
|
|
|
ast-stats-2 WherePredicate 72 ( 1.0%) 1 72
|
|
|
|
|
ast-stats-2 - BoundPredicate 72 ( 1.0%) 1
|
Move `ast::Item::ident` into `ast::ItemKind`.
`ast::Item` has an `ident` field.
- It's always non-empty for these item kinds: `ExternCrate`, `Static`,
`Const`, `Fn`, `Mod`, `TyAlias`, `Enum`, `Struct`, `Union`,
`Trait`, `TraitAlias`, `MacroDef`, `Delegation`.
- It's always empty for these item kinds: `Use`, `ForeignMod`,
`GlobalAsm`, `Impl`, `MacCall`, `DelegationMac`.
There is a similar story for `AssocItemKind` and `ForeignItemKind`.
Some sites that handle items check for an empty ident, some don't. This
is a very C-like way of doing things, but this is Rust, we have sum
types, we can do this properly and never forget to check for the
exceptional case and never YOLO possibly empty identifiers (or possibly
dummy spans) around and hope that things will work out.
The commit is large but it's mostly obvious plumbing work. Some notable
things.
- `ast::Item` got 8 bytes bigger. This could be avoided by boxing the
fields within some of the `ast::ItemKind` variants (specifically:
`Struct`, `Union`, `Enum`). I might do that in a follow-up; this
commit is big enough already.
- For the visitors: `FnKind` no longer needs an `ident` field because
the `Fn` within how has one.
- In the parser, the `ItemInfo` typedef is no longer needed. It was used
in various places to return an `Ident` alongside an `ItemKind`, but
now the `Ident` (if present) is within the `ItemKind`.
- In a few places I renamed identifier variables called `name` (or
`foo_name`) as `ident` (or `foo_ident`), to better match the type, and
because `name` is normally used for `Symbol`s. It's confusing to see
something like `foo_name.name`.
2025-03-21 09:47:43 +11:00
|
|
|
ast-stats-2 ForeignItem 80 ( 1.1%) 1 80
|
|
|
|
|
ast-stats-2 - Fn 80 ( 1.1%) 1
|
Detect more cases of `=` to `:` typo
When a `Local` is fully parsed, but not followed by a `;`, keep the `:` span
arround and mention it. If the type could continue being parsed as an
expression, suggest replacing the `:` with a `=`.
```
error: expected one of `!`, `+`, `->`, `::`, `;`, or `=`, found `.`
--> file.rs:2:32
|
2 | let _: std::env::temp_dir().join("foo");
| - ^ expected one of `!`, `+`, `->`, `::`, `;`, or `=`
| |
| while parsing the type for `_`
| help: use `=` if you meant to assign
```
Fix #119665.
2024-02-27 00:48:32 +00:00
|
|
|
ast-stats-2 Local 80 ( 1.1%) 1 80
|
2023-11-24 14:32:05 +00:00
|
|
|
ast-stats-2 Arm 96 ( 1.3%) 2 48
|
2024-06-26 15:25:57 +03:00
|
|
|
ast-stats-2 FnDecl 120 ( 1.6%) 5 24
|
2024-10-17 19:50:59 +02:00
|
|
|
ast-stats-2 InlineAsm 120 ( 1.6%) 1 120
|
2024-08-24 17:22:48 +00:00
|
|
|
ast-stats-2 Attribute 128 ( 1.7%) 4 32
|
2023-11-24 14:32:05 +00:00
|
|
|
ast-stats-2 - DocComment 32 ( 0.4%) 1
|
|
|
|
|
ast-stats-2 - Normal 96 ( 1.3%) 3
|
2024-10-17 19:50:59 +02:00
|
|
|
ast-stats-2 Param 160 ( 2.2%) 4 40
|
2023-11-24 14:32:05 +00:00
|
|
|
ast-stats-2 Stmt 160 ( 2.2%) 5 32
|
2024-03-14 12:00:46 +01:00
|
|
|
ast-stats-2 - Let 32 ( 0.4%) 1
|
2023-11-24 14:32:05 +00:00
|
|
|
ast-stats-2 - Semi 32 ( 0.4%) 1
|
|
|
|
|
ast-stats-2 - Expr 96 ( 1.3%) 3
|
2024-06-26 15:25:57 +03:00
|
|
|
ast-stats-2 Block 192 ( 2.6%) 6 32
|
2024-08-24 17:22:48 +00:00
|
|
|
ast-stats-2 FieldDef 208 ( 2.8%) 2 104
|
2024-10-27 01:35:33 +02:00
|
|
|
ast-stats-2 Variant 208 ( 2.8%) 2 104
|
Move `ast::Item::ident` into `ast::ItemKind`.
`ast::Item` has an `ident` field.
- It's always non-empty for these item kinds: `ExternCrate`, `Static`,
`Const`, `Fn`, `Mod`, `TyAlias`, `Enum`, `Struct`, `Union`,
`Trait`, `TraitAlias`, `MacroDef`, `Delegation`.
- It's always empty for these item kinds: `Use`, `ForeignMod`,
`GlobalAsm`, `Impl`, `MacCall`, `DelegationMac`.
There is a similar story for `AssocItemKind` and `ForeignItemKind`.
Some sites that handle items check for an empty ident, some don't. This
is a very C-like way of doing things, but this is Rust, we have sum
types, we can do this properly and never forget to check for the
exceptional case and never YOLO possibly empty identifiers (or possibly
dummy spans) around and hope that things will work out.
The commit is large but it's mostly obvious plumbing work. Some notable
things.
- `ast::Item` got 8 bytes bigger. This could be avoided by boxing the
fields within some of the `ast::ItemKind` variants (specifically:
`Struct`, `Union`, `Enum`). I might do that in a follow-up; this
commit is big enough already.
- For the visitors: `FnKind` no longer needs an `ident` field because
the `Fn` within how has one.
- In the parser, the `ItemInfo` typedef is no longer needed. It was used
in various places to return an `Ident` alongside an `ItemKind`, but
now the `Ident` (if present) is within the `ItemKind`.
- In a few places I renamed identifier variables called `name` (or
`foo_name`) as `ident` (or `foo_ident`), to better match the type, and
because `name` is normally used for `Symbol`s. It's confusing to see
something like `foo_name.name`.
2025-03-21 09:47:43 +11:00
|
|
|
ast-stats-2 AssocItem 320 ( 4.3%) 4 80
|
|
|
|
|
ast-stats-2 - Fn 160 ( 2.2%) 2
|
|
|
|
|
ast-stats-2 - Type 160 ( 2.2%) 2
|
2024-10-17 19:50:59 +02:00
|
|
|
ast-stats-2 GenericBound 352 ( 4.8%) 4 88
|
|
|
|
|
ast-stats-2 - Trait 352 ( 4.8%) 4
|
2024-08-24 17:22:48 +00:00
|
|
|
ast-stats-2 GenericParam 480 ( 6.5%) 5 96
|
Move `ast::Item::ident` into `ast::ItemKind`.
`ast::Item` has an `ident` field.
- It's always non-empty for these item kinds: `ExternCrate`, `Static`,
`Const`, `Fn`, `Mod`, `TyAlias`, `Enum`, `Struct`, `Union`,
`Trait`, `TraitAlias`, `MacroDef`, `Delegation`.
- It's always empty for these item kinds: `Use`, `ForeignMod`,
`GlobalAsm`, `Impl`, `MacCall`, `DelegationMac`.
There is a similar story for `AssocItemKind` and `ForeignItemKind`.
Some sites that handle items check for an empty ident, some don't. This
is a very C-like way of doing things, but this is Rust, we have sum
types, we can do this properly and never forget to check for the
exceptional case and never YOLO possibly empty identifiers (or possibly
dummy spans) around and hope that things will work out.
The commit is large but it's mostly obvious plumbing work. Some notable
things.
- `ast::Item` got 8 bytes bigger. This could be avoided by boxing the
fields within some of the `ast::ItemKind` variants (specifically:
`Struct`, `Union`, `Enum`). I might do that in a follow-up; this
commit is big enough already.
- For the visitors: `FnKind` no longer needs an `ident` field because
the `Fn` within how has one.
- In the parser, the `ItemInfo` typedef is no longer needed. It was used
in various places to return an `Ident` alongside an `ItemKind`, but
now the `Ident` (if present) is within the `ItemKind`.
- In a few places I renamed identifier variables called `name` (or
`foo_name`) as `ident` (or `foo_ident`), to better match the type, and
because `name` is normally used for `Symbol`s. It's confusing to see
something like `foo_name.name`.
2025-03-21 09:47:43 +11:00
|
|
|
ast-stats-2 Pat 504 ( 6.8%) 7 72
|
2023-01-30 14:58:23 +11:00
|
|
|
ast-stats-2 - Struct 72 ( 1.0%) 1
|
|
|
|
|
ast-stats-2 - Wild 72 ( 1.0%) 1
|
2024-06-26 15:25:57 +03:00
|
|
|
ast-stats-2 - Ident 360 ( 4.9%) 5
|
2024-08-24 17:22:48 +00:00
|
|
|
ast-stats-2 Expr 648 ( 8.8%) 9 72
|
2024-12-17 14:44:35 +11:00
|
|
|
ast-stats-2 - InlineAsm 72 ( 1.0%) 1
|
2022-11-23 11:55:16 +11:00
|
|
|
ast-stats-2 - Match 72 ( 1.0%) 1
|
2024-12-17 14:44:35 +11:00
|
|
|
ast-stats-2 - Path 72 ( 1.0%) 1
|
2022-11-23 11:55:16 +11:00
|
|
|
ast-stats-2 - Struct 72 ( 1.0%) 1
|
Move `ast::Item::ident` into `ast::ItemKind`.
`ast::Item` has an `ident` field.
- It's always non-empty for these item kinds: `ExternCrate`, `Static`,
`Const`, `Fn`, `Mod`, `TyAlias`, `Enum`, `Struct`, `Union`,
`Trait`, `TraitAlias`, `MacroDef`, `Delegation`.
- It's always empty for these item kinds: `Use`, `ForeignMod`,
`GlobalAsm`, `Impl`, `MacCall`, `DelegationMac`.
There is a similar story for `AssocItemKind` and `ForeignItemKind`.
Some sites that handle items check for an empty ident, some don't. This
is a very C-like way of doing things, but this is Rust, we have sum
types, we can do this properly and never forget to check for the
exceptional case and never YOLO possibly empty identifiers (or possibly
dummy spans) around and hope that things will work out.
The commit is large but it's mostly obvious plumbing work. Some notable
things.
- `ast::Item` got 8 bytes bigger. This could be avoided by boxing the
fields within some of the `ast::ItemKind` variants (specifically:
`Struct`, `Union`, `Enum`). I might do that in a follow-up; this
commit is big enough already.
- For the visitors: `FnKind` no longer needs an `ident` field because
the `Fn` within how has one.
- In the parser, the `ItemInfo` typedef is no longer needed. It was used
in various places to return an `Ident` alongside an `ItemKind`, but
now the `Ident` (if present) is within the `ItemKind`.
- In a few places I renamed identifier variables called `name` (or
`foo_name`) as `ident` (or `foo_ident`), to better match the type, and
because `name` is normally used for `Symbol`s. It's confusing to see
something like `foo_name.name`.
2025-03-21 09:47:43 +11:00
|
|
|
ast-stats-2 - Lit 144 ( 1.9%) 2
|
2024-08-24 17:22:48 +00:00
|
|
|
ast-stats-2 - Block 216 ( 2.9%) 3
|
Move `ast::Item::ident` into `ast::ItemKind`.
`ast::Item` has an `ident` field.
- It's always non-empty for these item kinds: `ExternCrate`, `Static`,
`Const`, `Fn`, `Mod`, `TyAlias`, `Enum`, `Struct`, `Union`,
`Trait`, `TraitAlias`, `MacroDef`, `Delegation`.
- It's always empty for these item kinds: `Use`, `ForeignMod`,
`GlobalAsm`, `Impl`, `MacCall`, `DelegationMac`.
There is a similar story for `AssocItemKind` and `ForeignItemKind`.
Some sites that handle items check for an empty ident, some don't. This
is a very C-like way of doing things, but this is Rust, we have sum
types, we can do this properly and never forget to check for the
exceptional case and never YOLO possibly empty identifiers (or possibly
dummy spans) around and hope that things will work out.
The commit is large but it's mostly obvious plumbing work. Some notable
things.
- `ast::Item` got 8 bytes bigger. This could be avoided by boxing the
fields within some of the `ast::ItemKind` variants (specifically:
`Struct`, `Union`, `Enum`). I might do that in a follow-up; this
commit is big enough already.
- For the visitors: `FnKind` no longer needs an `ident` field because
the `Fn` within how has one.
- In the parser, the `ItemInfo` typedef is no longer needed. It was used
in various places to return an `Ident` alongside an `ItemKind`, but
now the `Ident` (if present) is within the `ItemKind`.
- In a few places I renamed identifier variables called `name` (or
`foo_name`) as `ident` (or `foo_ident`), to better match the type, and
because `name` is normally used for `Symbol`s. It's confusing to see
something like `foo_name.name`.
2025-03-21 09:47:43 +11:00
|
|
|
ast-stats-2 PathSegment 864 (11.7%) 36 24
|
|
|
|
|
ast-stats-2 Ty 896 (12.1%) 14 64
|
2024-10-17 19:50:59 +02:00
|
|
|
ast-stats-2 - Ptr 64 ( 0.9%) 1
|
2024-12-17 14:44:35 +11:00
|
|
|
ast-stats-2 - Ref 64 ( 0.9%) 1
|
2024-08-24 17:22:48 +00:00
|
|
|
ast-stats-2 - ImplicitSelf 128 ( 1.7%) 2
|
Move `ast::Item::ident` into `ast::ItemKind`.
`ast::Item` has an `ident` field.
- It's always non-empty for these item kinds: `ExternCrate`, `Static`,
`Const`, `Fn`, `Mod`, `TyAlias`, `Enum`, `Struct`, `Union`,
`Trait`, `TraitAlias`, `MacroDef`, `Delegation`.
- It's always empty for these item kinds: `Use`, `ForeignMod`,
`GlobalAsm`, `Impl`, `MacCall`, `DelegationMac`.
There is a similar story for `AssocItemKind` and `ForeignItemKind`.
Some sites that handle items check for an empty ident, some don't. This
is a very C-like way of doing things, but this is Rust, we have sum
types, we can do this properly and never forget to check for the
exceptional case and never YOLO possibly empty identifiers (or possibly
dummy spans) around and hope that things will work out.
The commit is large but it's mostly obvious plumbing work. Some notable
things.
- `ast::Item` got 8 bytes bigger. This could be avoided by boxing the
fields within some of the `ast::ItemKind` variants (specifically:
`Struct`, `Union`, `Enum`). I might do that in a follow-up; this
commit is big enough already.
- For the visitors: `FnKind` no longer needs an `ident` field because
the `Fn` within how has one.
- In the parser, the `ItemInfo` typedef is no longer needed. It was used
in various places to return an `Ident` alongside an `ItemKind`, but
now the `Ident` (if present) is within the `ItemKind`.
- In a few places I renamed identifier variables called `name` (or
`foo_name`) as `ident` (or `foo_ident`), to better match the type, and
because `name` is normally used for `Symbol`s. It's confusing to see
something like `foo_name.name`.
2025-03-21 09:47:43 +11:00
|
|
|
ast-stats-2 - Path 640 ( 8.6%) 10
|
|
|
|
|
ast-stats-2 Item 1_584 (21.4%) 11 144
|
|
|
|
|
ast-stats-2 - Enum 144 ( 1.9%) 1
|
|
|
|
|
ast-stats-2 - ExternCrate 144 ( 1.9%) 1
|
|
|
|
|
ast-stats-2 - ForeignMod 144 ( 1.9%) 1
|
|
|
|
|
ast-stats-2 - Impl 144 ( 1.9%) 1
|
|
|
|
|
ast-stats-2 - Trait 144 ( 1.9%) 1
|
|
|
|
|
ast-stats-2 - Fn 288 ( 3.9%) 2
|
|
|
|
|
ast-stats-2 - Use 576 ( 7.8%) 4
|
2022-08-26 13:52:41 +10:00
|
|
|
ast-stats-2 ----------------------------------------------------------------
|
Move `ast::Item::ident` into `ast::ItemKind`.
`ast::Item` has an `ident` field.
- It's always non-empty for these item kinds: `ExternCrate`, `Static`,
`Const`, `Fn`, `Mod`, `TyAlias`, `Enum`, `Struct`, `Union`,
`Trait`, `TraitAlias`, `MacroDef`, `Delegation`.
- It's always empty for these item kinds: `Use`, `ForeignMod`,
`GlobalAsm`, `Impl`, `MacCall`, `DelegationMac`.
There is a similar story for `AssocItemKind` and `ForeignItemKind`.
Some sites that handle items check for an empty ident, some don't. This
is a very C-like way of doing things, but this is Rust, we have sum
types, we can do this properly and never forget to check for the
exceptional case and never YOLO possibly empty identifiers (or possibly
dummy spans) around and hope that things will work out.
The commit is large but it's mostly obvious plumbing work. Some notable
things.
- `ast::Item` got 8 bytes bigger. This could be avoided by boxing the
fields within some of the `ast::ItemKind` variants (specifically:
`Struct`, `Union`, `Enum`). I might do that in a follow-up; this
commit is big enough already.
- For the visitors: `FnKind` no longer needs an `ident` field because
the `Fn` within how has one.
- In the parser, the `ItemInfo` typedef is no longer needed. It was used
in various places to return an `Ident` alongside an `ItemKind`, but
now the `Ident` (if present) is within the `ItemKind`.
- In a few places I renamed identifier variables called `name` (or
`foo_name`) as `ident` (or `foo_ident`), to better match the type, and
because `name` is normally used for `Symbol`s. It's confusing to see
something like `foo_name.name`.
2025-03-21 09:47:43 +11:00
|
|
|
ast-stats-2 Total 7_400 127
|
2022-08-26 13:52:41 +10:00
|
|
|
ast-stats-2
|
|
|
|
|
hir-stats HIR STATS
|
|
|
|
|
hir-stats Name Accumulated Size Count Item Size
|
|
|
|
|
hir-stats ----------------------------------------------------------------
|
2022-09-16 11:45:33 +10:00
|
|
|
hir-stats ForeignItemRef 24 ( 0.3%) 1 24
|
2025-03-25 08:21:28 +11:00
|
|
|
hir-stats Lifetime 28 ( 0.3%) 1 28
|
2022-12-01 18:51:20 +03:00
|
|
|
hir-stats Mod 32 ( 0.4%) 1 32
|
2022-08-29 11:10:56 +10:00
|
|
|
hir-stats ExprField 40 ( 0.4%) 1 40
|
2022-03-08 19:07:01 +00:00
|
|
|
hir-stats TraitItemRef 56 ( 0.6%) 2 28
|
2024-07-16 19:07:36 -07:00
|
|
|
hir-stats GenericArg 64 ( 0.7%) 4 16
|
|
|
|
|
hir-stats - Type 16 ( 0.2%) 1
|
|
|
|
|
hir-stats - Lifetime 48 ( 0.5%) 3
|
2022-09-01 12:06:48 +10:00
|
|
|
hir-stats Local 64 ( 0.7%) 1 64
|
|
|
|
|
hir-stats Param 64 ( 0.7%) 2 32
|
2023-12-22 21:29:12 +00:00
|
|
|
hir-stats Body 72 ( 0.8%) 3 24
|
2022-09-16 11:45:33 +10:00
|
|
|
hir-stats ImplItemRef 72 ( 0.8%) 2 36
|
2024-10-17 19:50:59 +02:00
|
|
|
hir-stats InlineAsm 72 ( 0.8%) 1 72
|
2024-11-25 16:38:35 +08:00
|
|
|
hir-stats WherePredicate 72 ( 0.8%) 3 24
|
|
|
|
|
hir-stats - BoundPredicate 72 ( 0.8%) 3
|
2023-09-21 11:26:50 +00:00
|
|
|
hir-stats Arm 80 ( 0.9%) 2 40
|
2022-12-01 18:51:20 +03:00
|
|
|
hir-stats Stmt 96 ( 1.1%) 3 32
|
2024-12-17 14:44:35 +11:00
|
|
|
hir-stats - Expr 32 ( 0.4%) 1
|
2024-03-14 12:00:46 +01:00
|
|
|
hir-stats - Let 32 ( 0.4%) 1
|
2022-12-01 18:51:20 +03:00
|
|
|
hir-stats - Semi 32 ( 0.4%) 1
|
2022-09-16 11:45:33 +10:00
|
|
|
hir-stats FnDecl 120 ( 1.3%) 3 40
|
|
|
|
|
hir-stats Attribute 128 ( 1.4%) 4 32
|
2024-08-24 17:22:48 +00:00
|
|
|
hir-stats FieldDef 128 ( 1.4%) 2 64
|
2022-09-16 11:45:33 +10:00
|
|
|
hir-stats GenericArgs 144 ( 1.6%) 3 48
|
2024-10-17 19:50:59 +02:00
|
|
|
hir-stats Variant 144 ( 1.6%) 2 72
|
2024-11-25 16:38:35 +08:00
|
|
|
hir-stats GenericBound 256 ( 2.9%) 4 64
|
|
|
|
|
hir-stats - Trait 256 ( 2.9%) 4
|
2022-12-01 18:51:20 +03:00
|
|
|
hir-stats Block 288 ( 3.2%) 6 48
|
2023-12-22 21:29:12 +00:00
|
|
|
hir-stats Pat 360 ( 4.0%) 5 72
|
2022-09-16 11:45:33 +10:00
|
|
|
hir-stats - Struct 72 ( 0.8%) 1
|
2024-10-17 19:50:59 +02:00
|
|
|
hir-stats - Wild 72 ( 0.8%) 1
|
2022-09-16 11:45:33 +10:00
|
|
|
hir-stats - Binding 216 ( 2.4%) 3
|
2025-01-01 16:55:10 +00:00
|
|
|
hir-stats GenericParam 400 ( 4.5%) 5 80
|
|
|
|
|
hir-stats Generics 560 ( 6.2%) 10 56
|
|
|
|
|
hir-stats Ty 720 ( 8.0%) 15 48
|
2024-10-17 19:50:59 +02:00
|
|
|
hir-stats - Ptr 48 ( 0.5%) 1
|
2024-12-17 14:44:35 +11:00
|
|
|
hir-stats - Ref 48 ( 0.5%) 1
|
2025-03-25 08:21:28 +11:00
|
|
|
hir-stats - Path 624 ( 6.9%) 13
|
2024-11-25 16:38:35 +08:00
|
|
|
hir-stats Expr 768 ( 8.6%) 12 64
|
2024-12-17 14:44:35 +11:00
|
|
|
hir-stats - InlineAsm 64 ( 0.7%) 1
|
2022-09-01 12:06:48 +10:00
|
|
|
hir-stats - Match 64 ( 0.7%) 1
|
2024-12-17 14:44:35 +11:00
|
|
|
hir-stats - Path 64 ( 0.7%) 1
|
2024-10-17 19:50:59 +02:00
|
|
|
hir-stats - Struct 64 ( 0.7%) 1
|
2022-09-16 11:45:33 +10:00
|
|
|
hir-stats - Lit 128 ( 1.4%) 2
|
2024-11-25 16:38:35 +08:00
|
|
|
hir-stats - Block 384 ( 4.3%) 6
|
2024-08-24 17:22:48 +00:00
|
|
|
hir-stats Item 968 (10.8%) 11 88
|
2023-09-14 22:38:07 +00:00
|
|
|
hir-stats - Enum 88 ( 1.0%) 1
|
|
|
|
|
hir-stats - ExternCrate 88 ( 1.0%) 1
|
|
|
|
|
hir-stats - ForeignMod 88 ( 1.0%) 1
|
2024-12-17 14:44:35 +11:00
|
|
|
hir-stats - Impl 88 ( 1.0%) 1
|
|
|
|
|
hir-stats - Trait 88 ( 1.0%) 1
|
2024-11-25 16:38:35 +08:00
|
|
|
hir-stats - Fn 176 ( 2.0%) 2
|
2023-09-14 22:38:07 +00:00
|
|
|
hir-stats - Use 352 ( 3.9%) 4
|
2025-01-01 16:55:10 +00:00
|
|
|
hir-stats Path 1_240 (13.8%) 31 40
|
|
|
|
|
hir-stats PathSegment 1_920 (21.4%) 40 48
|
2022-08-26 13:52:41 +10:00
|
|
|
hir-stats ----------------------------------------------------------------
|
2025-03-25 08:21:28 +11:00
|
|
|
hir-stats Total 8_980 180
|
2022-08-26 13:52:41 +10:00
|
|
|
hir-stats
|