diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2022-11-23 11:55:16 +1100 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2023-02-21 11:51:56 +1100 |
| commit | 4143b101f9b0949c4bc6db1124f86ef02b1ef7aa (patch) | |
| tree | ccec1e793829bc4ce4095fc02cc647ba8b6f63f2 /tests | |
| parent | 6a56c3a930733b7e000cc3ec54844b0522a8bd16 (diff) | |
| download | rust-4143b101f9b0949c4bc6db1124f86ef02b1ef7aa.tar.gz rust-4143b101f9b0949c4bc6db1124f86ef02b1ef7aa.zip | |
Use `ThinVec` in various AST types.
This commit changes the sequence parsers to produce `ThinVec`, which triggers numerous conversions.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/ui-fulldeps/pprust-expr-roundtrip.rs | 8 | ||||
| -rw-r--r-- | tests/ui/stats/hir-stats.stderr | 152 |
2 files changed, 80 insertions, 80 deletions
diff --git a/tests/ui-fulldeps/pprust-expr-roundtrip.rs b/tests/ui-fulldeps/pprust-expr-roundtrip.rs index 7a91dcf0dad..1f0e96b954b 100644 --- a/tests/ui-fulldeps/pprust-expr-roundtrip.rs +++ b/tests/ui-fulldeps/pprust-expr-roundtrip.rs @@ -76,17 +76,17 @@ fn iter_exprs(depth: usize, f: &mut dyn FnMut(P<Expr>)) { for kind in 0..=19 { match kind { 0 => iter_exprs(depth - 1, &mut |e| g(ExprKind::Box(e))), - 1 => iter_exprs(depth - 1, &mut |e| g(ExprKind::Call(e, vec![]))), + 1 => iter_exprs(depth - 1, &mut |e| g(ExprKind::Call(e, thin_vec![]))), 2 => { let seg = PathSegment::from_ident(Ident::from_str("x")); iter_exprs(depth - 1, &mut |e| { g(ExprKind::MethodCall(Box::new(MethodCall { - seg: seg.clone(), receiver: e, args: vec![make_x()], span: DUMMY_SP + seg: seg.clone(), receiver: e, args: thin_vec![make_x()], span: DUMMY_SP })) )}); iter_exprs(depth - 1, &mut |e| { g(ExprKind::MethodCall(Box::new(MethodCall { - seg: seg.clone(), receiver: make_x(), args: vec![e], span: DUMMY_SP + seg: seg.clone(), receiver: make_x(), args: thin_vec![e], span: DUMMY_SP })) )}); } @@ -121,7 +121,7 @@ fn iter_exprs(depth: usize, f: &mut dyn FnMut(P<Expr>)) { iter_exprs(depth - 1, &mut |e| g(ExprKind::If(e, block.clone(), None))); } 11 => { - let decl = P(FnDecl { inputs: vec![], output: FnRetTy::Default(DUMMY_SP) }); + let decl = P(FnDecl { inputs: thin_vec![], output: FnRetTy::Default(DUMMY_SP) }); iter_exprs(depth - 1, &mut |e| { g(ExprKind::Closure(Box::new(Closure { binder: ClosureBinder::NotPresent, diff --git a/tests/ui/stats/hir-stats.stderr b/tests/ui/stats/hir-stats.stderr index 47d3382fc64..a46d725b94b 100644 --- a/tests/ui/stats/hir-stats.stderr +++ b/tests/ui/stats/hir-stats.stderr @@ -1,119 +1,119 @@ ast-stats-1 PRE EXPANSION AST STATS ast-stats-1 Name Accumulated Size Count Item Size ast-stats-1 ---------------------------------------------------------------- +ast-stats-1 GenericArgs 40 ( 0.6%) 1 40 +ast-stats-1 - AngleBracketed 40 ( 0.6%) 1 ast-stats-1 ExprField 48 ( 0.7%) 1 48 ast-stats-1 WherePredicate 56 ( 0.8%) 1 56 ast-stats-1 - BoundPredicate 56 ( 0.8%) 1 -ast-stats-1 GenericArgs 56 ( 0.8%) 1 56 -ast-stats-1 - AngleBracketed 56 ( 0.8%) 1 ast-stats-1 Crate 56 ( 0.8%) 1 56 ast-stats-1 Attribute 64 ( 0.9%) 2 32 ast-stats-1 - Normal 32 ( 0.5%) 1 ast-stats-1 - DocComment 32 ( 0.5%) 1 -ast-stats-1 Local 72 ( 1.0%) 1 72 +ast-stats-1 Local 72 ( 1.1%) 1 72 ast-stats-1 Arm 96 ( 1.4%) 2 48 ast-stats-1 ForeignItem 96 ( 1.4%) 1 96 ast-stats-1 - Fn 96 ( 1.4%) 1 +ast-stats-1 FnDecl 120 ( 1.8%) 5 24 ast-stats-1 FieldDef 160 ( 2.3%) 2 80 ast-stats-1 Stmt 160 ( 2.3%) 5 32 ast-stats-1 - Local 32 ( 0.5%) 1 ast-stats-1 - MacCall 32 ( 0.5%) 1 ast-stats-1 - Expr 96 ( 1.4%) 3 ast-stats-1 Param 160 ( 2.3%) 4 40 -ast-stats-1 FnDecl 200 ( 2.8%) 5 40 -ast-stats-1 GenericBound 224 ( 3.2%) 4 56 -ast-stats-1 - Trait 224 ( 3.2%) 4 -ast-stats-1 Variant 240 ( 3.4%) 2 120 -ast-stats-1 Block 288 ( 4.1%) 6 48 -ast-stats-1 AssocItem 416 ( 5.9%) 4 104 +ast-stats-1 Variant 208 ( 3.0%) 2 104 +ast-stats-1 GenericBound 224 ( 3.3%) 4 56 +ast-stats-1 - Trait 224 ( 3.3%) 4 +ast-stats-1 Block 288 ( 4.2%) 6 48 +ast-stats-1 AssocItem 416 ( 6.1%) 4 104 ast-stats-1 - Type 208 ( 3.0%) 2 ast-stats-1 - Fn 208 ( 3.0%) 2 -ast-stats-1 GenericParam 480 ( 6.8%) 5 96 -ast-stats-1 Expr 576 ( 8.2%) 8 72 -ast-stats-1 - Path 72 ( 1.0%) 1 -ast-stats-1 - Match 72 ( 1.0%) 1 -ast-stats-1 - Struct 72 ( 1.0%) 1 -ast-stats-1 - Lit 144 ( 2.0%) 2 -ast-stats-1 - Block 216 ( 3.1%) 3 -ast-stats-1 Pat 616 ( 8.7%) 7 88 -ast-stats-1 - Struct 88 ( 1.2%) 1 -ast-stats-1 - Wild 88 ( 1.2%) 1 -ast-stats-1 - Ident 440 ( 6.2%) 5 -ast-stats-1 PathSegment 720 (10.2%) 30 24 -ast-stats-1 Ty 896 (12.7%) 14 64 +ast-stats-1 GenericParam 480 ( 7.0%) 5 96 +ast-stats-1 Expr 576 ( 8.4%) 8 72 +ast-stats-1 - Path 72 ( 1.1%) 1 +ast-stats-1 - Match 72 ( 1.1%) 1 +ast-stats-1 - Struct 72 ( 1.1%) 1 +ast-stats-1 - Lit 144 ( 2.1%) 2 +ast-stats-1 - Block 216 ( 3.2%) 3 +ast-stats-1 Pat 616 ( 9.0%) 7 88 +ast-stats-1 - Struct 88 ( 1.3%) 1 +ast-stats-1 - Wild 88 ( 1.3%) 1 +ast-stats-1 - Ident 440 ( 6.4%) 5 +ast-stats-1 PathSegment 720 (10.5%) 30 24 +ast-stats-1 Ty 896 (13.1%) 14 64 ast-stats-1 - Ptr 64 ( 0.9%) 1 ast-stats-1 - Ref 64 ( 0.9%) 1 -ast-stats-1 - ImplicitSelf 128 ( 1.8%) 2 -ast-stats-1 - Path 640 ( 9.1%) 10 -ast-stats-1 Item 1_368 (19.4%) 9 152 -ast-stats-1 - Trait 152 ( 2.2%) 1 -ast-stats-1 - Enum 152 ( 2.2%) 1 -ast-stats-1 - ForeignMod 152 ( 2.2%) 1 -ast-stats-1 - Impl 152 ( 2.2%) 1 -ast-stats-1 - Fn 304 ( 4.3%) 2 -ast-stats-1 - Use 456 ( 6.5%) 3 +ast-stats-1 - ImplicitSelf 128 ( 1.9%) 2 +ast-stats-1 - Path 640 ( 9.3%) 10 +ast-stats-1 Item 1_296 (18.9%) 9 144 +ast-stats-1 - Trait 144 ( 2.1%) 1 +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 - Fn 288 ( 4.2%) 2 +ast-stats-1 - Use 432 ( 6.3%) 3 ast-stats-1 ---------------------------------------------------------------- -ast-stats-1 Total 7_048 +ast-stats-1 Total 6_848 ast-stats-1 ast-stats-2 POST EXPANSION AST STATS ast-stats-2 Name Accumulated Size Count Item Size ast-stats-2 ---------------------------------------------------------------- +ast-stats-2 GenericArgs 40 ( 0.5%) 1 40 +ast-stats-2 - AngleBracketed 40 ( 0.5%) 1 ast-stats-2 ExprField 48 ( 0.6%) 1 48 -ast-stats-2 WherePredicate 56 ( 0.7%) 1 56 -ast-stats-2 - BoundPredicate 56 ( 0.7%) 1 -ast-stats-2 GenericArgs 56 ( 0.7%) 1 56 -ast-stats-2 - AngleBracketed 56 ( 0.7%) 1 -ast-stats-2 Crate 56 ( 0.7%) 1 56 -ast-stats-2 Local 72 ( 0.9%) 1 72 -ast-stats-2 Arm 96 ( 1.2%) 2 48 -ast-stats-2 ForeignItem 96 ( 1.2%) 1 96 -ast-stats-2 - Fn 96 ( 1.2%) 1 +ast-stats-2 WherePredicate 56 ( 0.8%) 1 56 +ast-stats-2 - BoundPredicate 56 ( 0.8%) 1 +ast-stats-2 Crate 56 ( 0.8%) 1 56 +ast-stats-2 Local 72 ( 1.0%) 1 72 +ast-stats-2 Arm 96 ( 1.3%) 2 48 +ast-stats-2 ForeignItem 96 ( 1.3%) 1 96 +ast-stats-2 - Fn 96 ( 1.3%) 1 ast-stats-2 InlineAsm 120 ( 1.6%) 1 120 +ast-stats-2 FnDecl 120 ( 1.6%) 5 24 ast-stats-2 Attribute 128 ( 1.7%) 4 32 ast-stats-2 - DocComment 32 ( 0.4%) 1 -ast-stats-2 - Normal 96 ( 1.2%) 3 +ast-stats-2 - Normal 96 ( 1.3%) 3 ast-stats-2 FieldDef 160 ( 2.1%) 2 80 ast-stats-2 Stmt 160 ( 2.1%) 5 32 ast-stats-2 - Local 32 ( 0.4%) 1 ast-stats-2 - Semi 32 ( 0.4%) 1 -ast-stats-2 - Expr 96 ( 1.2%) 3 +ast-stats-2 - Expr 96 ( 1.3%) 3 ast-stats-2 Param 160 ( 2.1%) 4 40 -ast-stats-2 FnDecl 200 ( 2.6%) 5 40 -ast-stats-2 GenericBound 224 ( 2.9%) 4 56 -ast-stats-2 - Trait 224 ( 2.9%) 4 -ast-stats-2 Variant 240 ( 3.1%) 2 120 -ast-stats-2 Block 288 ( 3.8%) 6 48 -ast-stats-2 AssocItem 416 ( 5.4%) 4 104 -ast-stats-2 - Type 208 ( 2.7%) 2 -ast-stats-2 - Fn 208 ( 2.7%) 2 -ast-stats-2 GenericParam 480 ( 6.2%) 5 96 -ast-stats-2 Pat 616 ( 8.0%) 7 88 -ast-stats-2 - Struct 88 ( 1.1%) 1 -ast-stats-2 - Wild 88 ( 1.1%) 1 -ast-stats-2 - Ident 440 ( 5.7%) 5 -ast-stats-2 Expr 648 ( 8.4%) 9 72 -ast-stats-2 - Path 72 ( 0.9%) 1 -ast-stats-2 - Match 72 ( 0.9%) 1 -ast-stats-2 - Struct 72 ( 0.9%) 1 -ast-stats-2 - InlineAsm 72 ( 0.9%) 1 +ast-stats-2 Variant 208 ( 2.8%) 2 104 +ast-stats-2 GenericBound 224 ( 3.0%) 4 56 +ast-stats-2 - Trait 224 ( 3.0%) 4 +ast-stats-2 Block 288 ( 3.9%) 6 48 +ast-stats-2 AssocItem 416 ( 5.6%) 4 104 +ast-stats-2 - Type 208 ( 2.8%) 2 +ast-stats-2 - Fn 208 ( 2.8%) 2 +ast-stats-2 GenericParam 480 ( 6.4%) 5 96 +ast-stats-2 Pat 616 ( 8.3%) 7 88 +ast-stats-2 - Struct 88 ( 1.2%) 1 +ast-stats-2 - Wild 88 ( 1.2%) 1 +ast-stats-2 - Ident 440 ( 5.9%) 5 +ast-stats-2 Expr 648 ( 8.7%) 9 72 +ast-stats-2 - Path 72 ( 1.0%) 1 +ast-stats-2 - Match 72 ( 1.0%) 1 +ast-stats-2 - Struct 72 ( 1.0%) 1 +ast-stats-2 - InlineAsm 72 ( 1.0%) 1 ast-stats-2 - Lit 144 ( 1.9%) 2 -ast-stats-2 - Block 216 ( 2.8%) 3 -ast-stats-2 PathSegment 792 (10.3%) 33 24 -ast-stats-2 Ty 896 (11.7%) 14 64 -ast-stats-2 - Ptr 64 ( 0.8%) 1 -ast-stats-2 - Ref 64 ( 0.8%) 1 +ast-stats-2 - Block 216 ( 2.9%) 3 +ast-stats-2 PathSegment 792 (10.6%) 33 24 +ast-stats-2 Ty 896 (12.0%) 14 64 +ast-stats-2 - Ptr 64 ( 0.9%) 1 +ast-stats-2 - Ref 64 ( 0.9%) 1 ast-stats-2 - ImplicitSelf 128 ( 1.7%) 2 -ast-stats-2 - Path 640 ( 8.3%) 10 -ast-stats-2 Item 1_672 (21.8%) 11 152 -ast-stats-2 - Trait 152 ( 2.0%) 1 -ast-stats-2 - Enum 152 ( 2.0%) 1 -ast-stats-2 - ExternCrate 152 ( 2.0%) 1 -ast-stats-2 - ForeignMod 152 ( 2.0%) 1 -ast-stats-2 - Impl 152 ( 2.0%) 1 -ast-stats-2 - Fn 304 ( 4.0%) 2 -ast-stats-2 - Use 608 ( 7.9%) 4 +ast-stats-2 - Path 640 ( 8.6%) 10 +ast-stats-2 Item 1_584 (21.2%) 11 144 +ast-stats-2 - Trait 144 ( 1.9%) 1 +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 - Fn 288 ( 3.9%) 2 +ast-stats-2 - Use 576 ( 7.7%) 4 ast-stats-2 ---------------------------------------------------------------- -ast-stats-2 Total 7_680 +ast-stats-2 Total 7_464 ast-stats-2 hir-stats HIR STATS hir-stats Name Accumulated Size Count Item Size |
