rust-code-analysis 0.0.18

Tool to compute and export code metrics
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
// Code generated; DO NOT EDIT.

#[derive(Clone, Debug, PartialEq)]
pub enum Rust {
    End = 0,
    Identifier = 1,
    SEMI = 2,
    MacroRulesBANG = 3,
    LPAREN = 4,
    RPAREN = 5,
    LBRACE = 6,
    RBRACE = 7,
    EQGT = 8,
    LBRACK = 9,
    RBRACK = 10,
    COLON = 11,
    DOLLAR = 12,
    TokenRepetitionPatternToken1 = 13,
    PLUS = 14,
    STAR = 15,
    QMARK = 16,
    Block2 = 17,
    Expr = 18,
    Ident = 19,
    Item = 20,
    Lifetime2 = 21,
    Literal2 = 22,
    Meta = 23,
    Pat = 24,
    Path = 25,
    Stmt = 26,
    Tt = 27,
    Ty = 28,
    Vis = 29,
    U8 = 30,
    I8 = 31,
    U16 = 32,
    I16 = 33,
    U32 = 34,
    I32 = 35,
    U64 = 36,
    I64 = 37,
    U128 = 38,
    I128 = 39,
    Isize = 40,
    Usize = 41,
    F32 = 42,
    F64 = 43,
    Bool = 44,
    Str = 45,
    Char = 46,
    NonSpecialTokenToken1 = 47,
    SQUOTE = 48,
    As = 49,
    Async = 50,
    Await = 51,
    Break = 52,
    Const = 53,
    Continue = 54,
    Default = 55,
    Enum = 56,
    Fn = 57,
    For = 58,
    If = 59,
    Impl = 60,
    Let = 61,
    Loop = 62,
    Match = 63,
    Mod = 64,
    Pub = 65,
    Return = 66,
    Static = 67,
    Struct = 68,
    Trait = 69,
    Type2 = 70,
    Union = 71,
    Unsafe = 72,
    Use = 73,
    Where = 74,
    While = 75,
    HASH = 76,
    BANG = 77,
    EQ = 78,
    COMMA = 79,
    Extern = 80,
    Ref = 81,
    DASHGT = 82,
    LT = 83,
    GT = 84,
    COLONCOLON = 85,
    UNDERSCORE = 86,
    AMP = 87,
    DOTDOTDOT = 88,
    In = 89,
    LT2 = 90,
    Dyn = 91,
    MutableSpecifier = 92,
    DOTDOT = 93,
    DOTDOTEQ = 94,
    DASH = 95,
    AMPAMP = 96,
    PIPEPIPE = 97,
    PIPE = 98,
    CARET = 99,
    EQEQ = 100,
    BANGEQ = 101,
    LTEQ = 102,
    GTEQ = 103,
    LTLT = 104,
    GTGT = 105,
    SLASH = 106,
    PERCENT = 107,
    PLUSEQ = 108,
    DASHEQ = 109,
    STAREQ = 110,
    SLASHEQ = 111,
    PERCENTEQ = 112,
    AMPEQ = 113,
    PIPEEQ = 114,
    CARETEQ = 115,
    LTLTEQ = 116,
    GTGTEQ = 117,
    Else = 118,
    Move = 119,
    DOT = 120,
    AT = 121,
    IntegerLiteral = 122,
    DQUOTE = 123,
    DQUOTE2 = 124,
    CharLiteral = 125,
    EscapeSequence = 126,
    True = 127,
    False = 128,
    LineComment = 129,
    Zelf = 130,
    Super = 131,
    Crate = 132,
    Metavariable = 133,
    StringContent = 134,
    RawStringLiteral = 135,
    FloatLiteral = 136,
    BlockComment = 137,
    SourceFile = 138,
    Statement = 139,
    EmptyStatement = 140,
    ExpressionStatement = 141,
    MacroDefinition = 142,
    MacroRule = 143,
    TokenPattern = 144,
    TokenTreePattern = 145,
    TokenBindingPattern = 146,
    TokenRepetitionPattern = 147,
    FragmentSpecifier = 148,
    TokenTree = 149,
    TokenRepetition = 150,
    AttributeItem = 151,
    InnerAttributeItem = 152,
    MetaItem = 153,
    MetaArguments = 154,
    ModItem = 155,
    ForeignModItem = 156,
    DeclarationList = 157,
    StructItem = 158,
    UnionItem = 159,
    EnumItem = 160,
    EnumVariantList = 161,
    EnumVariant = 162,
    FieldDeclarationList = 163,
    FieldDeclaration = 164,
    OrderedFieldDeclarationList = 165,
    ExternCrateDeclaration = 166,
    ConstItem = 167,
    StaticItem = 168,
    TypeItem = 169,
    FunctionItem = 170,
    FunctionSignatureItem = 171,
    FunctionModifiers = 172,
    WhereClause = 173,
    WherePredicate = 174,
    ImplItem = 175,
    TraitItem = 176,
    AssociatedType = 177,
    TraitBounds = 178,
    HigherRankedTraitBound = 179,
    RemovedTraitBound = 180,
    TypeParameters = 181,
    ConstParameter = 182,
    ConstrainedTypeParameter = 183,
    OptionalTypeParameter = 184,
    LetDeclaration = 185,
    UseDeclaration = 186,
    UseClause = 187,
    ScopedUseList = 188,
    UseList = 189,
    UseAsClause = 190,
    UseWildcard = 191,
    Parameters = 192,
    SelfParameter = 193,
    VariadicParameter = 194,
    Parameter = 195,
    ExternModifier = 196,
    VisibilityModifier = 197,
    Type = 198,
    BracketedType = 199,
    QualifiedType = 200,
    Lifetime = 201,
    ArrayType = 202,
    ForLifetimes = 203,
    FunctionType = 204,
    TupleType = 205,
    UnitType = 206,
    GenericFunction = 207,
    GenericType = 208,
    GenericTypeWithTurbofish = 209,
    BoundedType = 210,
    TypeArguments = 211,
    TypeBinding = 212,
    ReferenceType = 213,
    PointerType = 214,
    EmptyType = 215,
    AbstractType = 216,
    DynamicType = 217,
    Expression = 218,
    MacroInvocation = 219,
    ScopedIdentifier = 220,
    ScopedTypeIdentifier = 221,
    ScopedTypeIdentifier2 = 222,
    RangeExpression = 223,
    UnaryExpression = 224,
    TryExpression = 225,
    ReferenceExpression = 226,
    BinaryExpression = 227,
    AssignmentExpression = 228,
    CompoundAssignmentExpr = 229,
    TypeCastExpression = 230,
    ReturnExpression = 231,
    CallExpression = 232,
    Arguments = 233,
    ArrayExpression = 234,
    ParenthesizedExpression = 235,
    TupleExpression = 236,
    UnitExpression = 237,
    StructExpression = 238,
    FieldInitializerList = 239,
    ShorthandFieldInitializer = 240,
    FieldInitializer = 241,
    BaseFieldInitializer = 242,
    IfExpression = 243,
    IfLetExpression = 244,
    ElseTail = 245,
    MatchExpression = 246,
    MatchBlock = 247,
    MatchArm = 248,
    MatchArm2 = 249,
    MatchPattern = 250,
    WhileExpression = 251,
    WhileLetExpression = 252,
    LoopExpression = 253,
    ForExpression = 254,
    ClosureExpression = 255,
    ClosureParameters = 256,
    LoopLabel = 257,
    BreakExpression = 258,
    ContinueExpression = 259,
    IndexExpression = 260,
    AwaitExpression = 261,
    FieldExpression = 262,
    UnsafeBlock = 263,
    AsyncBlock = 264,
    Block = 265,
    Pattern = 266,
    TuplePattern = 267,
    SlicePattern = 268,
    TupleStructPattern = 269,
    StructPattern = 270,
    FieldPattern = 271,
    RemainingFieldPattern = 272,
    MutPattern = 273,
    RangePattern = 274,
    RefPattern = 275,
    CapturedPattern = 276,
    ReferencePattern = 277,
    OrPattern = 278,
    Literal = 279,
    LiteralPattern = 280,
    NegativeLiteral = 281,
    StringLiteral = 282,
    BooleanLiteral = 283,
    SourceFileRepeat1 = 284,
    MacroDefinitionRepeat1 = 285,
    TokenTreePatternRepeat1 = 286,
    TokenTreeRepeat1 = 287,
    MetaArgumentsRepeat1 = 288,
    DeclarationListRepeat1 = 289,
    EnumVariantListRepeat1 = 290,
    EnumVariantListRepeat2 = 291,
    FieldDeclarationListRepeat1 = 292,
    OrderedFieldDeclarationListRepeat1 = 293,
    FunctionModifiersRepeat1 = 294,
    WhereClauseRepeat1 = 295,
    TraitBoundsRepeat1 = 296,
    TypeParametersRepeat1 = 297,
    UseListRepeat1 = 298,
    ParametersRepeat1 = 299,
    ForLifetimesRepeat1 = 300,
    TupleTypeRepeat1 = 301,
    TypeArgumentsRepeat1 = 302,
    ArgumentsRepeat1 = 303,
    ArrayExpressionRepeat1 = 304,
    TupleExpressionRepeat1 = 305,
    FieldInitializerListRepeat1 = 306,
    MatchBlockRepeat1 = 307,
    ClosureParametersRepeat1 = 308,
    TuplePatternRepeat1 = 309,
    StructPatternRepeat1 = 310,
    StringLiteralRepeat1 = 311,
    FieldIdentifier = 312,
    PrimitiveType = 313,
    ShorthandFieldIdentifier = 314,
    TypeIdentifier = 315,
    Error = 316,
}

impl Into<&'static str> for Rust {
    fn into(self) -> &'static str {
        match self {
            Rust::End => "end",
            Rust::Identifier => "identifier",
            Rust::SEMI => ";",
            Rust::MacroRulesBANG => "macro_rules!",
            Rust::LPAREN => "(",
            Rust::RPAREN => ")",
            Rust::LBRACE => "{",
            Rust::RBRACE => "}",
            Rust::EQGT => "=>",
            Rust::LBRACK => "[",
            Rust::RBRACK => "]",
            Rust::COLON => ":",
            Rust::DOLLAR => "$",
            Rust::TokenRepetitionPatternToken1 => "token_repetition_pattern_token1",
            Rust::PLUS => "+",
            Rust::STAR => "*",
            Rust::QMARK => "?",
            Rust::Block2 => "block",
            Rust::Expr => "expr",
            Rust::Ident => "ident",
            Rust::Item => "item",
            Rust::Lifetime2 => "lifetime",
            Rust::Literal2 => "literal",
            Rust::Meta => "meta",
            Rust::Pat => "pat",
            Rust::Path => "path",
            Rust::Stmt => "stmt",
            Rust::Tt => "tt",
            Rust::Ty => "ty",
            Rust::Vis => "vis",
            Rust::U8 => "u8",
            Rust::I8 => "i8",
            Rust::U16 => "u16",
            Rust::I16 => "i16",
            Rust::U32 => "u32",
            Rust::I32 => "i32",
            Rust::U64 => "u64",
            Rust::I64 => "i64",
            Rust::U128 => "u128",
            Rust::I128 => "i128",
            Rust::Isize => "isize",
            Rust::Usize => "usize",
            Rust::F32 => "f32",
            Rust::F64 => "f64",
            Rust::Bool => "bool",
            Rust::Str => "str",
            Rust::Char => "char",
            Rust::NonSpecialTokenToken1 => "_non_special_token_token1",
            Rust::SQUOTE => "'",
            Rust::As => "as",
            Rust::Async => "async",
            Rust::Await => "await",
            Rust::Break => "break",
            Rust::Const => "const",
            Rust::Continue => "continue",
            Rust::Default => "default",
            Rust::Enum => "enum",
            Rust::Fn => "fn",
            Rust::For => "for",
            Rust::If => "if",
            Rust::Impl => "impl",
            Rust::Let => "let",
            Rust::Loop => "loop",
            Rust::Match => "match",
            Rust::Mod => "mod",
            Rust::Pub => "pub",
            Rust::Return => "return",
            Rust::Static => "static",
            Rust::Struct => "struct",
            Rust::Trait => "trait",
            Rust::Type2 => "type",
            Rust::Union => "union",
            Rust::Unsafe => "unsafe",
            Rust::Use => "use",
            Rust::Where => "where",
            Rust::While => "while",
            Rust::HASH => "#",
            Rust::BANG => "!",
            Rust::EQ => "=",
            Rust::COMMA => ",",
            Rust::Extern => "extern",
            Rust::Ref => "ref",
            Rust::DASHGT => "->",
            Rust::LT => "<",
            Rust::GT => ">",
            Rust::COLONCOLON => "::",
            Rust::UNDERSCORE => "_",
            Rust::AMP => "&",
            Rust::DOTDOTDOT => "...",
            Rust::In => "in",
            Rust::LT2 => "<",
            Rust::Dyn => "dyn",
            Rust::MutableSpecifier => "mutable_specifier",
            Rust::DOTDOT => "..",
            Rust::DOTDOTEQ => "..=",
            Rust::DASH => "-",
            Rust::AMPAMP => "&&",
            Rust::PIPEPIPE => "||",
            Rust::PIPE => "|",
            Rust::CARET => "^",
            Rust::EQEQ => "==",
            Rust::BANGEQ => "!=",
            Rust::LTEQ => "<=",
            Rust::GTEQ => ">=",
            Rust::LTLT => "<<",
            Rust::GTGT => ">>",
            Rust::SLASH => "/",
            Rust::PERCENT => "%",
            Rust::PLUSEQ => "+=",
            Rust::DASHEQ => "-=",
            Rust::STAREQ => "*=",
            Rust::SLASHEQ => "/=",
            Rust::PERCENTEQ => "%=",
            Rust::AMPEQ => "&=",
            Rust::PIPEEQ => "|=",
            Rust::CARETEQ => "^=",
            Rust::LTLTEQ => "<<=",
            Rust::GTGTEQ => ">>=",
            Rust::Else => "else",
            Rust::Move => "move",
            Rust::DOT => ".",
            Rust::AT => "@",
            Rust::IntegerLiteral => "integer_literal",
            Rust::DQUOTE => "\"",
            Rust::DQUOTE2 => "\"",
            Rust::CharLiteral => "char_literal",
            Rust::EscapeSequence => "escape_sequence",
            Rust::True => "true",
            Rust::False => "false",
            Rust::LineComment => "line_comment",
            Rust::Zelf => "self",
            Rust::Super => "super",
            Rust::Crate => "crate",
            Rust::Metavariable => "metavariable",
            Rust::StringContent => "_string_content",
            Rust::RawStringLiteral => "raw_string_literal",
            Rust::FloatLiteral => "float_literal",
            Rust::BlockComment => "block_comment",
            Rust::SourceFile => "source_file",
            Rust::Statement => "_statement",
            Rust::EmptyStatement => "empty_statement",
            Rust::ExpressionStatement => "_expression_statement",
            Rust::MacroDefinition => "macro_definition",
            Rust::MacroRule => "macro_rule",
            Rust::TokenPattern => "_token_pattern",
            Rust::TokenTreePattern => "token_tree_pattern",
            Rust::TokenBindingPattern => "token_binding_pattern",
            Rust::TokenRepetitionPattern => "token_repetition_pattern",
            Rust::FragmentSpecifier => "fragment_specifier",
            Rust::TokenTree => "token_tree",
            Rust::TokenRepetition => "token_repetition",
            Rust::AttributeItem => "attribute_item",
            Rust::InnerAttributeItem => "inner_attribute_item",
            Rust::MetaItem => "meta_item",
            Rust::MetaArguments => "meta_arguments",
            Rust::ModItem => "mod_item",
            Rust::ForeignModItem => "foreign_mod_item",
            Rust::DeclarationList => "declaration_list",
            Rust::StructItem => "struct_item",
            Rust::UnionItem => "union_item",
            Rust::EnumItem => "enum_item",
            Rust::EnumVariantList => "enum_variant_list",
            Rust::EnumVariant => "enum_variant",
            Rust::FieldDeclarationList => "field_declaration_list",
            Rust::FieldDeclaration => "field_declaration",
            Rust::OrderedFieldDeclarationList => "ordered_field_declaration_list",
            Rust::ExternCrateDeclaration => "extern_crate_declaration",
            Rust::ConstItem => "const_item",
            Rust::StaticItem => "static_item",
            Rust::TypeItem => "type_item",
            Rust::FunctionItem => "function_item",
            Rust::FunctionSignatureItem => "function_signature_item",
            Rust::FunctionModifiers => "function_modifiers",
            Rust::WhereClause => "where_clause",
            Rust::WherePredicate => "where_predicate",
            Rust::ImplItem => "impl_item",
            Rust::TraitItem => "trait_item",
            Rust::AssociatedType => "associated_type",
            Rust::TraitBounds => "trait_bounds",
            Rust::HigherRankedTraitBound => "higher_ranked_trait_bound",
            Rust::RemovedTraitBound => "removed_trait_bound",
            Rust::TypeParameters => "type_parameters",
            Rust::ConstParameter => "const_parameter",
            Rust::ConstrainedTypeParameter => "constrained_type_parameter",
            Rust::OptionalTypeParameter => "optional_type_parameter",
            Rust::LetDeclaration => "let_declaration",
            Rust::UseDeclaration => "use_declaration",
            Rust::UseClause => "_use_clause",
            Rust::ScopedUseList => "scoped_use_list",
            Rust::UseList => "use_list",
            Rust::UseAsClause => "use_as_clause",
            Rust::UseWildcard => "use_wildcard",
            Rust::Parameters => "parameters",
            Rust::SelfParameter => "self_parameter",
            Rust::VariadicParameter => "variadic_parameter",
            Rust::Parameter => "parameter",
            Rust::ExternModifier => "extern_modifier",
            Rust::VisibilityModifier => "visibility_modifier",
            Rust::Type => "_type",
            Rust::BracketedType => "bracketed_type",
            Rust::QualifiedType => "qualified_type",
            Rust::Lifetime => "lifetime",
            Rust::ArrayType => "array_type",
            Rust::ForLifetimes => "for_lifetimes",
            Rust::FunctionType => "function_type",
            Rust::TupleType => "tuple_type",
            Rust::UnitType => "unit_type",
            Rust::GenericFunction => "generic_function",
            Rust::GenericType => "generic_type",
            Rust::GenericTypeWithTurbofish => "generic_type_with_turbofish",
            Rust::BoundedType => "bounded_type",
            Rust::TypeArguments => "type_arguments",
            Rust::TypeBinding => "type_binding",
            Rust::ReferenceType => "reference_type",
            Rust::PointerType => "pointer_type",
            Rust::EmptyType => "empty_type",
            Rust::AbstractType => "abstract_type",
            Rust::DynamicType => "dynamic_type",
            Rust::Expression => "_expression",
            Rust::MacroInvocation => "macro_invocation",
            Rust::ScopedIdentifier => "scoped_identifier",
            Rust::ScopedTypeIdentifier => "scoped_type_identifier",
            Rust::ScopedTypeIdentifier2 => "scoped_type_identifier",
            Rust::RangeExpression => "range_expression",
            Rust::UnaryExpression => "unary_expression",
            Rust::TryExpression => "try_expression",
            Rust::ReferenceExpression => "reference_expression",
            Rust::BinaryExpression => "binary_expression",
            Rust::AssignmentExpression => "assignment_expression",
            Rust::CompoundAssignmentExpr => "compound_assignment_expr",
            Rust::TypeCastExpression => "type_cast_expression",
            Rust::ReturnExpression => "return_expression",
            Rust::CallExpression => "call_expression",
            Rust::Arguments => "arguments",
            Rust::ArrayExpression => "array_expression",
            Rust::ParenthesizedExpression => "parenthesized_expression",
            Rust::TupleExpression => "tuple_expression",
            Rust::UnitExpression => "unit_expression",
            Rust::StructExpression => "struct_expression",
            Rust::FieldInitializerList => "field_initializer_list",
            Rust::ShorthandFieldInitializer => "shorthand_field_initializer",
            Rust::FieldInitializer => "field_initializer",
            Rust::BaseFieldInitializer => "base_field_initializer",
            Rust::IfExpression => "if_expression",
            Rust::IfLetExpression => "if_let_expression",
            Rust::ElseTail => "_else_tail",
            Rust::MatchExpression => "match_expression",
            Rust::MatchBlock => "match_block",
            Rust::MatchArm => "match_arm",
            Rust::MatchArm2 => "match_arm",
            Rust::MatchPattern => "match_pattern",
            Rust::WhileExpression => "while_expression",
            Rust::WhileLetExpression => "while_let_expression",
            Rust::LoopExpression => "loop_expression",
            Rust::ForExpression => "for_expression",
            Rust::ClosureExpression => "closure_expression",
            Rust::ClosureParameters => "closure_parameters",
            Rust::LoopLabel => "loop_label",
            Rust::BreakExpression => "break_expression",
            Rust::ContinueExpression => "continue_expression",
            Rust::IndexExpression => "index_expression",
            Rust::AwaitExpression => "await_expression",
            Rust::FieldExpression => "field_expression",
            Rust::UnsafeBlock => "unsafe_block",
            Rust::AsyncBlock => "async_block",
            Rust::Block => "block",
            Rust::Pattern => "_pattern",
            Rust::TuplePattern => "tuple_pattern",
            Rust::SlicePattern => "slice_pattern",
            Rust::TupleStructPattern => "tuple_struct_pattern",
            Rust::StructPattern => "struct_pattern",
            Rust::FieldPattern => "field_pattern",
            Rust::RemainingFieldPattern => "remaining_field_pattern",
            Rust::MutPattern => "mut_pattern",
            Rust::RangePattern => "range_pattern",
            Rust::RefPattern => "ref_pattern",
            Rust::CapturedPattern => "captured_pattern",
            Rust::ReferencePattern => "reference_pattern",
            Rust::OrPattern => "or_pattern",
            Rust::Literal => "_literal",
            Rust::LiteralPattern => "_literal_pattern",
            Rust::NegativeLiteral => "negative_literal",
            Rust::StringLiteral => "string_literal",
            Rust::BooleanLiteral => "boolean_literal",
            Rust::SourceFileRepeat1 => "source_file_repeat1",
            Rust::MacroDefinitionRepeat1 => "macro_definition_repeat1",
            Rust::TokenTreePatternRepeat1 => "token_tree_pattern_repeat1",
            Rust::TokenTreeRepeat1 => "token_tree_repeat1",
            Rust::MetaArgumentsRepeat1 => "meta_arguments_repeat1",
            Rust::DeclarationListRepeat1 => "declaration_list_repeat1",
            Rust::EnumVariantListRepeat1 => "enum_variant_list_repeat1",
            Rust::EnumVariantListRepeat2 => "enum_variant_list_repeat2",
            Rust::FieldDeclarationListRepeat1 => "field_declaration_list_repeat1",
            Rust::OrderedFieldDeclarationListRepeat1 => "ordered_field_declaration_list_repeat1",
            Rust::FunctionModifiersRepeat1 => "function_modifiers_repeat1",
            Rust::WhereClauseRepeat1 => "where_clause_repeat1",
            Rust::TraitBoundsRepeat1 => "trait_bounds_repeat1",
            Rust::TypeParametersRepeat1 => "type_parameters_repeat1",
            Rust::UseListRepeat1 => "use_list_repeat1",
            Rust::ParametersRepeat1 => "parameters_repeat1",
            Rust::ForLifetimesRepeat1 => "for_lifetimes_repeat1",
            Rust::TupleTypeRepeat1 => "tuple_type_repeat1",
            Rust::TypeArgumentsRepeat1 => "type_arguments_repeat1",
            Rust::ArgumentsRepeat1 => "arguments_repeat1",
            Rust::ArrayExpressionRepeat1 => "array_expression_repeat1",
            Rust::TupleExpressionRepeat1 => "tuple_expression_repeat1",
            Rust::FieldInitializerListRepeat1 => "field_initializer_list_repeat1",
            Rust::MatchBlockRepeat1 => "match_block_repeat1",
            Rust::ClosureParametersRepeat1 => "closure_parameters_repeat1",
            Rust::TuplePatternRepeat1 => "tuple_pattern_repeat1",
            Rust::StructPatternRepeat1 => "struct_pattern_repeat1",
            Rust::StringLiteralRepeat1 => "string_literal_repeat1",
            Rust::FieldIdentifier => "field_identifier",
            Rust::PrimitiveType => "primitive_type",
            Rust::ShorthandFieldIdentifier => "shorthand_field_identifier",
            Rust::TypeIdentifier => "type_identifier",
            Rust::Error => "ERROR",
        }
    }
}

#[allow(clippy::unreadable_literal)]
static KEYS: phf::Map<&'static str, Rust> = ::phf::Map {
    key: 3213172566270843353,
    disps: ::phf::Slice::Static(&[
        (0, 223),
        (0, 17),
        (0, 0),
        (3, 29),
        (2, 145),
        (0, 4),
        (0, 85),
        (0, 0),
        (0, 139),
        (0, 5),
        (0, 221),
        (2, 223),
        (8, 137),
        (4, 168),
        (0, 44),
        (2, 33),
        (0, 46),
        (0, 1),
        (0, 0),
        (0, 11),
        (0, 17),
        (0, 75),
        (0, 86),
        (0, 3),
        (0, 23),
        (1, 0),
        (25, 19),
        (0, 20),
        (0, 55),
        (0, 11),
        (7, 144),
        (17, 242),
        (11, 85),
        (0, 265),
        (2, 282),
        (0, 0),
        (0, 284),
        (19, 56),
        (0, 25),
        (0, 12),
        (1, 11),
        (0, 304),
        (0, 83),
        (36, 279),
        (0, 119),
        (0, 12),
        (0, 166),
        (3, 95),
        (0, 5),
        (0, 233),
        (0, 2),
        (0, 3),
        (0, 152),
        (95, 26),
        (9, 184),
        (0, 137),
        (0, 2),
        (2, 38),
        (4, 267),
        (2, 155),
        (0, 0),
        (0, 166),
    ]),
    entries: ::phf::Slice::Static(&[
        ("array_expression_repeat1", Rust::ArrayExpressionRepeat1),
        (
            "ordered_field_declaration_list_repeat1",
            Rust::OrderedFieldDeclarationListRepeat1,
        ),
        ("for_expression", Rust::ForExpression),
        ("optional_type_parameter", Rust::OptionalTypeParameter),
        ("match_pattern", Rust::MatchPattern),
        ("struct", Rust::Struct),
        ("field_initializer", Rust::FieldInitializer),
        ("<=", Rust::LTEQ),
        ("macro_definition_repeat1", Rust::MacroDefinitionRepeat1),
        ("enum", Rust::Enum),
        ("meta_arguments_repeat1", Rust::MetaArgumentsRepeat1),
        ("while_expression", Rust::WhileExpression),
        ("self_parameter", Rust::SelfParameter),
        ("ident", Rust::Ident),
        ("super", Rust::Super),
        ("u16", Rust::U16),
        ("line_comment", Rust::LineComment),
        ("|", Rust::PIPE),
        ("abstract_type", Rust::AbstractType),
        ("field_identifier", Rust::FieldIdentifier),
        ("trait", Rust::Trait),
        ("as", Rust::As),
        ("type_binding", Rust::TypeBinding),
        (
            "generic_type_with_turbofish",
            Rust::GenericTypeWithTurbofish,
        ),
        (
            "shorthand_field_initializer",
            Rust::ShorthandFieldInitializer,
        ),
        ("extern_crate_declaration", Rust::ExternCrateDeclaration),
        (">>=", Rust::GTGTEQ),
        ("match_arm", Rust::MatchArm),
        ("type_arguments_repeat1", Rust::TypeArgumentsRepeat1),
        ("tuple_type_repeat1", Rust::TupleTypeRepeat1),
        ("@", Rust::AT),
        ("?", Rust::QMARK),
        ("return_expression", Rust::ReturnExpression),
        ("mut_pattern", Rust::MutPattern),
        ("continue", Rust::Continue),
        ("use_as_clause", Rust::UseAsClause),
        ("static_item", Rust::StaticItem),
        ("(", Rust::LPAREN),
        ("function_type", Rust::FunctionType),
        ("let_declaration", Rust::LetDeclaration),
        ("extern", Rust::Extern),
        (";", Rust::SEMI),
        ("arguments", Rust::Arguments),
        ("let", Rust::Let),
        ("arguments_repeat1", Rust::ArgumentsRepeat1),
        ("match_block_repeat1", Rust::MatchBlockRepeat1),
        ("type_parameters", Rust::TypeParameters),
        ("escape_sequence", Rust::EscapeSequence),
        ("use", Rust::Use),
        ("source_file_repeat1", Rust::SourceFileRepeat1),
        ("metavariable", Rust::Metavariable),
        ("declaration_list_repeat1", Rust::DeclarationListRepeat1),
        ("boolean_literal", Rust::BooleanLiteral),
        ("type_identifier", Rust::TypeIdentifier),
        ("float_literal", Rust::FloatLiteral),
        ("while_let_expression", Rust::WhileLetExpression),
        ("match", Rust::Match),
        ("\'", Rust::SQUOTE),
        ("array_type", Rust::ArrayType),
        ("#", Rust::HASH),
        (">", Rust::GT),
        ("async", Rust::Async),
        ("lifetime", Rust::Lifetime),
        ("::", Rust::COLONCOLON),
        ("macro_definition", Rust::MacroDefinition),
        ("enum_item", Rust::EnumItem),
        ("await_expression", Rust::AwaitExpression),
        ("parenthesized_expression", Rust::ParenthesizedExpression),
        ("trait_bounds_repeat1", Rust::TraitBoundsRepeat1),
        ("ref", Rust::Ref),
        ("true", Rust::True),
        ("removed_trait_bound", Rust::RemovedTraitBound),
        ("slice_pattern", Rust::SlicePattern),
        ("if", Rust::If),
        ("_expression", Rust::Expression),
        ("string_literal_repeat1", Rust::StringLiteralRepeat1),
        ("impl_item", Rust::ImplItem),
        ("type_cast_expression", Rust::TypeCastExpression),
        ("self", Rust::Zelf),
        ("empty_type", Rust::EmptyType),
        ("empty_statement", Rust::EmptyStatement),
        ("type_arguments", Rust::TypeArguments),
        ("array_expression", Rust::ArrayExpression),
        ("\\\"", Rust::DQUOTE),
        ("negative_literal", Rust::NegativeLiteral),
        ("macro_invocation", Rust::MacroInvocation),
        ("declaration_list", Rust::DeclarationList),
        ("where", Rust::Where),
        ("break_expression", Rust::BreakExpression),
        ("loop", Rust::Loop),
        ("closure_expression", Rust::ClosureExpression),
        ("visibility_modifier", Rust::VisibilityModifier),
        ("loop_label", Rust::LoopLabel),
        ("..=", Rust::DOTDOTEQ),
        ("field_expression", Rust::FieldExpression),
        ("usize", Rust::Usize),
        ("where_clause_repeat1", Rust::WhereClauseRepeat1),
        ("macro_rules!", Rust::MacroRulesBANG),
        ("expr", Rust::Expr),
        (")", Rust::RPAREN),
        ("integer_literal", Rust::IntegerLiteral),
        ("{", Rust::LBRACE),
        ("str", Rust::Str),
        ("_statement", Rust::Statement),
        ("loop_expression", Rust::LoopExpression),
        ("/", Rust::SLASH),
        ("dyn", Rust::Dyn),
        ("shorthand_field_identifier", Rust::ShorthandFieldIdentifier),
        ("-", Rust::DASH),
        ("u8", Rust::U8),
        ("token_repetition", Rust::TokenRepetition),
        ("_non_special_token_token1", Rust::NonSpecialTokenToken1),
        (
            "field_initializer_list_repeat1",
            Rust::FieldInitializerListRepeat1,
        ),
        ("char_literal", Rust::CharLiteral),
        ("function_item", Rust::FunctionItem),
        ("while", Rust::While),
        ("tuple_expression", Rust::TupleExpression),
        ("assignment_expression", Rust::AssignmentExpression),
        ("use_wildcard", Rust::UseWildcard),
        ("where_clause", Rust::WhereClause),
        ("item", Rust::Item),
        ("enum_variant_list_repeat2", Rust::EnumVariantListRepeat2),
        ("}", Rust::RBRACE),
        ("&", Rust::AMP),
        ("_literal_pattern", Rust::LiteralPattern),
        ("else", Rust::Else),
        ("function_modifiers", Rust::FunctionModifiers),
        ("!", Rust::BANG),
        ("or_pattern", Rust::OrPattern),
        ("]", Rust::RBRACK),
        ("closure_parameters_repeat1", Rust::ClosureParametersRepeat1),
        ("tuple_struct_pattern", Rust::TupleStructPattern),
        ("identifier", Rust::Identifier),
        ("mod", Rust::Mod),
        ("!=", Rust::BANGEQ),
        ("bracketed_type", Rust::BracketedType),
        ("unary_expression", Rust::UnaryExpression),
        ("struct_pattern", Rust::StructPattern),
        ("generic_type", Rust::GenericType),
        ("tuple_expression_repeat1", Rust::TupleExpressionRepeat1),
        ("false", Rust::False),
        ("unit_expression", Rust::UnitExpression),
        ("remaining_field_pattern", Rust::RemainingFieldPattern),
        ("if_let_expression", Rust::IfLetExpression),
        ("i32", Rust::I32),
        ("^=", Rust::CARETEQ),
        ("i16", Rust::I16),
        ("impl", Rust::Impl),
        ("end", Rust::End),
        ("struct_pattern_repeat1", Rust::StructPatternRepeat1),
        ("union", Rust::Union),
        ("parameters_repeat1", Rust::ParametersRepeat1),
        ("field_declaration", Rust::FieldDeclaration),
        ("scoped_type_identifier", Rust::ScopedTypeIdentifier),
        ("call_expression", Rust::CallExpression),
        ("bool", Rust::Bool),
        ("meta", Rust::Meta),
        ("unsafe", Rust::Unsafe),
        ("source_file", Rust::SourceFile),
        (">>", Rust::GTGT),
        ("generic_function", Rust::GenericFunction),
        ("continue_expression", Rust::ContinueExpression),
        ("$", Rust::DOLLAR),
        ("&=", Rust::AMPEQ),
        ("block", Rust::Block),
        ("ERROR", Rust::Error),
        ("f64", Rust::F64),
        ("fragment_specifier", Rust::FragmentSpecifier),
        ("_literal", Rust::Literal),
        ("const_item", Rust::ConstItem),
        ("=>", Rust::EQGT),
        ("field_pattern", Rust::FieldPattern),
        (":", Rust::COLON),
        ("mutable_specifier", Rust::MutableSpecifier),
        ("break", Rust::Break),
        ("/=", Rust::SLASHEQ),
        (
            "token_repetition_pattern_token1",
            Rust::TokenRepetitionPatternToken1,
        ),
        ("+=", Rust::PLUSEQ),
        ("==", Rust::EQEQ),
        ("extern_modifier", Rust::ExternModifier),
        ("_type", Rust::Type),
        ("isize", Rust::Isize),
        ("_token_pattern", Rust::TokenPattern),
        ("||", Rust::PIPEPIPE),
        ("scoped_identifier", Rust::ScopedIdentifier),
        ("fn", Rust::Fn),
        ("foreign_mod_item", Rust::ForeignModItem),
        ("ref_pattern", Rust::RefPattern),
        ("=", Rust::EQ),
        ("unit_type", Rust::UnitType),
        ("+", Rust::PLUS),
        ("<<=", Rust::LTLTEQ),
        ("const", Rust::Const),
        ("block_comment", Rust::BlockComment),
        ("u128", Rust::U128),
        ("variadic_parameter", Rust::VariadicParameter),
        ("i128", Rust::I128),
        ("->", Rust::DASHGT),
        ("range_pattern", Rust::RangePattern),
        ("enum_variant", Rust::EnumVariant),
        ("...", Rust::DOTDOTDOT),
        ("i64", Rust::I64),
        ("enum_variant_list", Rust::EnumVariantList),
        ("default", Rust::Default),
        (">=", Rust::GTEQ),
        ("qualified_type", Rust::QualifiedType),
        ("_pattern", Rust::Pattern),
        ("primitive_type", Rust::PrimitiveType),
        ("token_binding_pattern", Rust::TokenBindingPattern),
        ("|=", Rust::PIPEEQ),
        ("scoped_use_list", Rust::ScopedUseList),
        ("_", Rust::UNDERSCORE),
        ("*", Rust::STAR),
        ("reference_pattern", Rust::ReferencePattern),
        ("_string_content", Rust::StringContent),
        ("function_signature_item", Rust::FunctionSignatureItem),
        ("<<", Rust::LTLT),
        ("field_initializer_list", Rust::FieldInitializerList),
        ("trait_item", Rust::TraitItem),
        ("%", Rust::PERCENT),
        ("pub", Rust::Pub),
        ("for_lifetimes", Rust::ForLifetimes),
        ("struct_expression", Rust::StructExpression),
        ("associated_type", Rust::AssociatedType),
        ("captured_pattern", Rust::CapturedPattern),
        ("binary_expression", Rust::BinaryExpression),
        ("string_literal", Rust::StringLiteral),
        ("tuple_pattern", Rust::TuplePattern),
        ("-=", Rust::DASHEQ),
        ("closure_parameters", Rust::ClosureParameters),
        ("crate", Rust::Crate),
        ("field_declaration_list", Rust::FieldDeclarationList),
        ("*=", Rust::STAREQ),
        ("meta_arguments", Rust::MetaArguments),
        ("token_tree_repeat1", Rust::TokenTreeRepeat1),
        ("pointer_type", Rust::PointerType),
        (
            "field_declaration_list_repeat1",
            Rust::FieldDeclarationListRepeat1,
        ),
        ("token_tree_pattern_repeat1", Rust::TokenTreePatternRepeat1),
        ("^", Rust::CARET),
        ("match_expression", Rust::MatchExpression),
        ("type_item", Rust::TypeItem),
        ("use_list_repeat1", Rust::UseListRepeat1),
        ("[", Rust::LBRACK),
        ("meta_item", Rust::MetaItem),
        ("type_parameters_repeat1", Rust::TypeParametersRepeat1),
        ("bounded_type", Rust::BoundedType),
        ("const_parameter", Rust::ConstParameter),
        ("tuple_pattern_repeat1", Rust::TuplePatternRepeat1),
        ("parameter", Rust::Parameter),
        ("return", Rust::Return),
        ("token_tree_pattern", Rust::TokenTreePattern),
        ("reference_type", Rust::ReferenceType),
        ("token_tree", Rust::TokenTree),
        ("where_predicate", Rust::WherePredicate),
        ("use_declaration", Rust::UseDeclaration),
        ("reference_expression", Rust::ReferenceExpression),
        ("inner_attribute_item", Rust::InnerAttributeItem),
        ("union_item", Rust::UnionItem),
        ("range_expression", Rust::RangeExpression),
        ("i8", Rust::I8),
        ("use_list", Rust::UseList),
        ("trait_bounds", Rust::TraitBounds),
        ("compound_assignment_expr", Rust::CompoundAssignmentExpr),
        ("raw_string_literal", Rust::RawStringLiteral),
        ("f32", Rust::F32),
        ("index_expression", Rust::IndexExpression),
        ("_else_tail", Rust::ElseTail),
        ("higher_ranked_trait_bound", Rust::HigherRankedTraitBound),
        ("path", Rust::Path),
        ("char", Rust::Char),
        ("dynamic_type", Rust::DynamicType),
        ("for", Rust::For),
        ("enum_variant_list_repeat1", Rust::EnumVariantListRepeat1),
        ("u64", Rust::U64),
        ("&&", Rust::AMPAMP),
        ("u32", Rust::U32),
        ("move", Rust::Move),
        ("tuple_type", Rust::TupleType),
        ("tt", Rust::Tt),
        ("ty", Rust::Ty),
        (",", Rust::COMMA),
        ("_expression_statement", Rust::ExpressionStatement),
        (
            "ordered_field_declaration_list",
            Rust::OrderedFieldDeclarationList,
        ),
        ("%=", Rust::PERCENTEQ),
        (".", Rust::DOT),
        ("in", Rust::In),
        ("token_repetition_pattern", Rust::TokenRepetitionPattern),
        ("constrained_type_parameter", Rust::ConstrainedTypeParameter),
        ("attribute_item", Rust::AttributeItem),
        ("macro_rule", Rust::MacroRule),
        ("base_field_initializer", Rust::BaseFieldInitializer),
        ("struct_item", Rust::StructItem),
        ("async_block", Rust::AsyncBlock),
        ("function_modifiers_repeat1", Rust::FunctionModifiersRepeat1),
        ("..", Rust::DOTDOT),
        ("try_expression", Rust::TryExpression),
        ("await", Rust::Await),
        ("match_block", Rust::MatchBlock),
        ("if_expression", Rust::IfExpression),
        ("for_lifetimes_repeat1", Rust::ForLifetimesRepeat1),
        ("vis", Rust::Vis),
        ("stmt", Rust::Stmt),
        ("unsafe_block", Rust::UnsafeBlock),
        ("static", Rust::Static),
        ("<", Rust::LT),
        ("_use_clause", Rust::UseClause),
        ("pat", Rust::Pat),
        ("parameters", Rust::Parameters),
        ("mod_item", Rust::ModItem),
    ]),
};

impl From<&str> for Rust {
    #[inline(always)]
    fn from(key: &str) -> Self {
        KEYS.get(key).unwrap().clone()
    }
}

impl From<u16> for Rust {
    #[inline(always)]
    fn from(x: u16) -> Self {
        unsafe { std::mem::transmute(x) }
    }
}

// Rust == u16
impl PartialEq<u16> for Rust {
    #[inline(always)]
    fn eq(&self, x: &u16) -> bool {
        *self == Rust::from(*x)
    }
}

// u16 == Rust
impl PartialEq<Rust> for u16 {
    #[inline(always)]
    fn eq(&self, x: &Rust) -> bool {
        *x == *self
    }
}