Skip to content

Commit ecdb297

Browse files
CohenArthurdkm
authored andcommitted
chore: ast: Fix formatting in rust-expr.h
gcc/rust/ChangeLog: * ast/rust-expr.h: Fix formatting.
1 parent 9f89054 commit ecdb297

File tree

1 file changed

+43
-46
lines changed

1 file changed

+43
-46
lines changed

gcc/rust/ast/rust-expr.h

Lines changed: 43 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1163,11 +1163,11 @@ class ArrayElems
11631163
// Value array elements
11641164
class ArrayElemsValues : public ArrayElems
11651165
{
1166-
std::vector<std::unique_ptr<Expr> > values;
1166+
std::vector<std::unique_ptr<Expr>> values;
11671167
location_t locus;
11681168

11691169
public:
1170-
ArrayElemsValues (std::vector<std::unique_ptr<Expr> > elems, location_t locus)
1170+
ArrayElemsValues (std::vector<std::unique_ptr<Expr>> elems, location_t locus)
11711171
: ArrayElems (), values (std::move (elems)), locus (locus)
11721172
{}
11731173

@@ -1200,11 +1200,11 @@ class ArrayElemsValues : public ArrayElems
12001200
void accept_vis (ASTVisitor &vis) override;
12011201

12021202
// TODO: this mutable getter seems really dodgy. Think up better way.
1203-
const std::vector<std::unique_ptr<Expr> > &get_values () const
1203+
const std::vector<std::unique_ptr<Expr>> &get_values () const
12041204
{
12051205
return values;
12061206
}
1207-
std::vector<std::unique_ptr<Expr> > &get_values () { return values; }
1207+
std::vector<std::unique_ptr<Expr>> &get_values () { return values; }
12081208

12091209
size_t get_num_values () const { return values.size (); }
12101210

@@ -1481,7 +1481,7 @@ class TupleExpr : public ExprWithoutBlock
14811481
{
14821482
std::vector<Attribute> outer_attrs;
14831483
std::vector<Attribute> inner_attrs;
1484-
std::vector<std::unique_ptr<Expr> > tuple_elems;
1484+
std::vector<std::unique_ptr<Expr>> tuple_elems;
14851485
location_t locus;
14861486

14871487
// TODO: find another way to store this to save memory?
@@ -1501,7 +1501,7 @@ class TupleExpr : public ExprWithoutBlock
15011501
outer_attrs = std::move (new_attrs);
15021502
}
15031503

1504-
TupleExpr (std::vector<std::unique_ptr<Expr> > tuple_elements,
1504+
TupleExpr (std::vector<std::unique_ptr<Expr>> tuple_elements,
15051505
std::vector<Attribute> inner_attribs,
15061506
std::vector<Attribute> outer_attribs, location_t locus)
15071507
: outer_attrs (std::move (outer_attribs)),
@@ -1552,14 +1552,11 @@ class TupleExpr : public ExprWithoutBlock
15521552
bool is_marked_for_strip () const override { return marked_for_strip; }
15531553

15541554
// TODO: this mutable getter seems really dodgy. Think up better way.
1555-
const std::vector<std::unique_ptr<Expr> > &get_tuple_elems () const
1556-
{
1557-
return tuple_elems;
1558-
}
1559-
std::vector<std::unique_ptr<Expr> > &get_tuple_elems ()
1555+
const std::vector<std::unique_ptr<Expr>> &get_tuple_elems () const
15601556
{
15611557
return tuple_elems;
15621558
}
1559+
std::vector<std::unique_ptr<Expr>> &get_tuple_elems () { return tuple_elems; }
15631560

15641561
bool is_unit () const { return tuple_elems.size () == 0; }
15651562

@@ -1983,7 +1980,7 @@ class StructExprFieldIndexValue : public StructExprFieldWithVal
19831980
class StructExprStructFields : public StructExprStruct
19841981
{
19851982
// std::vector<StructExprField> fields;
1986-
std::vector<std::unique_ptr<StructExprField> > fields;
1983+
std::vector<std::unique_ptr<StructExprField>> fields;
19871984

19881985
// bool has_struct_base;
19891986
StructBase struct_base;
@@ -1996,8 +1993,8 @@ class StructExprStructFields : public StructExprStruct
19961993
// Constructor for StructExprStructFields when no struct base is used
19971994
StructExprStructFields (
19981995
PathInExpression struct_path,
1999-
std::vector<std::unique_ptr<StructExprField> > expr_fields,
2000-
location_t locus, StructBase base_struct = StructBase::error (),
1996+
std::vector<std::unique_ptr<StructExprField>> expr_fields, location_t locus,
1997+
StructBase base_struct = StructBase::error (),
20011998
std::vector<Attribute> inner_attribs = std::vector<Attribute> (),
20021999
std::vector<Attribute> outer_attribs = std::vector<Attribute> ())
20032000
: StructExprStruct (std::move (struct_path), std::move (inner_attribs),
@@ -2034,11 +2031,11 @@ class StructExprStructFields : public StructExprStruct
20342031
void accept_vis (ASTVisitor &vis) override;
20352032

20362033
// TODO: this mutable getter seems really dodgy. Think up better way.
2037-
std::vector<std::unique_ptr<StructExprField> > &get_fields ()
2034+
std::vector<std::unique_ptr<StructExprField>> &get_fields ()
20382035
{
20392036
return fields;
20402037
}
2041-
const std::vector<std::unique_ptr<StructExprField> > &get_fields () const
2038+
const std::vector<std::unique_ptr<StructExprField>> &get_fields () const
20422039
{
20432040
return fields;
20442041
}
@@ -2095,7 +2092,7 @@ class CallExpr : public ExprWithoutBlock
20952092
{
20962093
std::vector<Attribute> outer_attrs;
20972094
std::unique_ptr<Expr> function;
2098-
std::vector<std::unique_ptr<Expr> > params;
2095+
std::vector<std::unique_ptr<Expr>> params;
20992096
location_t locus;
21002097

21012098
public:
@@ -2104,7 +2101,7 @@ class CallExpr : public ExprWithoutBlock
21042101
std::string as_string () const override;
21052102

21062103
CallExpr (std::unique_ptr<Expr> function_expr,
2107-
std::vector<std::unique_ptr<Expr> > function_params,
2104+
std::vector<std::unique_ptr<Expr>> function_params,
21082105
std::vector<Attribute> outer_attribs, location_t locus)
21092106
: outer_attrs (std::move (outer_attribs)),
21102107
function (std::move (function_expr)),
@@ -2161,11 +2158,11 @@ class CallExpr : public ExprWithoutBlock
21612158
bool is_marked_for_strip () const override { return function == nullptr; }
21622159

21632160
// TODO: this mutable getter seems really dodgy. Think up better way.
2164-
const std::vector<std::unique_ptr<Expr> > &get_params () const
2161+
const std::vector<std::unique_ptr<Expr>> &get_params () const
21652162
{
21662163
return params;
21672164
}
2168-
std::vector<std::unique_ptr<Expr> > &get_params () { return params; }
2165+
std::vector<std::unique_ptr<Expr>> &get_params () { return params; }
21692166

21702167
// TODO: is this better? Or is a "vis_block" better?
21712168
Expr &get_function_expr ()
@@ -2201,15 +2198,15 @@ class MethodCallExpr : public ExprWithoutBlock
22012198
std::vector<Attribute> outer_attrs;
22022199
std::unique_ptr<Expr> receiver;
22032200
PathExprSegment method_name;
2204-
std::vector<std::unique_ptr<Expr> > params;
2201+
std::vector<std::unique_ptr<Expr>> params;
22052202
location_t locus;
22062203

22072204
public:
22082205
std::string as_string () const override;
22092206

22102207
MethodCallExpr (std::unique_ptr<Expr> call_receiver,
22112208
PathExprSegment method_path,
2212-
std::vector<std::unique_ptr<Expr> > method_params,
2209+
std::vector<std::unique_ptr<Expr>> method_params,
22132210
std::vector<Attribute> outer_attribs, location_t locus)
22142211
: outer_attrs (std::move (outer_attribs)),
22152212
receiver (std::move (call_receiver)),
@@ -2265,11 +2262,11 @@ class MethodCallExpr : public ExprWithoutBlock
22652262
bool is_marked_for_strip () const override { return receiver == nullptr; }
22662263

22672264
// TODO: this mutable getter seems really dodgy. Think up better way.
2268-
const std::vector<std::unique_ptr<Expr> > &get_params () const
2265+
const std::vector<std::unique_ptr<Expr>> &get_params () const
22692266
{
22702267
return params;
22712268
}
2272-
std::vector<std::unique_ptr<Expr> > &get_params () { return params; }
2269+
std::vector<std::unique_ptr<Expr>> &get_params () { return params; }
22732270

22742271
// TODO: is this better? Or is a "vis_block" better?
22752272
Expr &get_receiver_expr ()
@@ -2596,7 +2593,7 @@ class BlockExpr : public ExprWithBlock
25962593
{
25972594
std::vector<Attribute> outer_attrs;
25982595
std::vector<Attribute> inner_attrs;
2599-
std::vector<std::unique_ptr<Stmt> > statements;
2596+
std::vector<std::unique_ptr<Stmt>> statements;
26002597
std::unique_ptr<Expr> expr;
26012598
tl::optional<LoopLabel> label;
26022599
location_t start_locus;
@@ -2612,7 +2609,7 @@ class BlockExpr : public ExprWithBlock
26122609
// Returns whether the block contains a final expression.
26132610
bool has_tail_expr () const { return expr != nullptr; }
26142611

2615-
BlockExpr (std::vector<std::unique_ptr<Stmt> > block_statements,
2612+
BlockExpr (std::vector<std::unique_ptr<Stmt>> block_statements,
26162613
std::unique_ptr<Expr> block_expr,
26172614
std::vector<Attribute> inner_attribs,
26182615
std::vector<Attribute> outer_attribs,
@@ -2691,11 +2688,11 @@ class BlockExpr : public ExprWithBlock
26912688
const std::vector<Attribute> &get_inner_attrs () const { return inner_attrs; }
26922689
std::vector<Attribute> &get_inner_attrs () { return inner_attrs; }
26932690

2694-
const std::vector<std::unique_ptr<Stmt> > &get_statements () const
2691+
const std::vector<std::unique_ptr<Stmt>> &get_statements () const
26952692
{
26962693
return statements;
26972694
}
2698-
std::vector<std::unique_ptr<Stmt> > &get_statements () { return statements; }
2695+
std::vector<std::unique_ptr<Stmt>> &get_statements () { return statements; }
26992696

27002697
// TODO: is this better? Or is a "vis_block" better?
27012698
Expr &get_tail_expr ()
@@ -4081,14 +4078,14 @@ class WhileLoopExpr : public BaseLoopExpr
40814078
class WhileLetLoopExpr : public BaseLoopExpr
40824079
{
40834080
// MatchArmPatterns patterns;
4084-
std::vector<std::unique_ptr<Pattern> > match_arm_patterns; // inlined
4081+
std::vector<std::unique_ptr<Pattern>> match_arm_patterns; // inlined
40854082
std::unique_ptr<Expr> scrutinee;
40864083

40874084
public:
40884085
std::string as_string () const override;
40894086

40904087
// Constructor with a loop label
4091-
WhileLetLoopExpr (std::vector<std::unique_ptr<Pattern> > match_arm_patterns,
4088+
WhileLetLoopExpr (std::vector<std::unique_ptr<Pattern>> match_arm_patterns,
40924089
std::unique_ptr<Expr> scrutinee,
40934090
std::unique_ptr<BlockExpr> loop_block, location_t locus,
40944091
tl::optional<LoopLabel> loop_label = tl::nullopt,
@@ -4142,11 +4139,11 @@ class WhileLetLoopExpr : public BaseLoopExpr
41424139
}
41434140

41444141
// TODO: this mutable getter seems really dodgy. Think up better way.
4145-
const std::vector<std::unique_ptr<Pattern> > &get_patterns () const
4142+
const std::vector<std::unique_ptr<Pattern>> &get_patterns () const
41464143
{
41474144
return match_arm_patterns;
41484145
}
4149-
std::vector<std::unique_ptr<Pattern> > &get_patterns ()
4146+
std::vector<std::unique_ptr<Pattern>> &get_patterns ()
41504147
{
41514148
return match_arm_patterns;
41524149
}
@@ -4429,15 +4426,15 @@ class IfExprConseqElse : public IfExpr
44294426
class IfLetExpr : public ExprWithBlock
44304427
{
44314428
std::vector<Attribute> outer_attrs;
4432-
std::vector<std::unique_ptr<Pattern> > match_arm_patterns; // inlined
4429+
std::vector<std::unique_ptr<Pattern>> match_arm_patterns; // inlined
44334430
std::unique_ptr<Expr> value;
44344431
std::unique_ptr<BlockExpr> if_block;
44354432
location_t locus;
44364433

44374434
public:
44384435
std::string as_string () const override;
44394436

4440-
IfLetExpr (std::vector<std::unique_ptr<Pattern> > match_arm_patterns,
4437+
IfLetExpr (std::vector<std::unique_ptr<Pattern>> match_arm_patterns,
44414438
std::unique_ptr<Expr> value, std::unique_ptr<BlockExpr> if_block,
44424439
std::vector<Attribute> outer_attrs, location_t locus)
44434440
: outer_attrs (std::move (outer_attrs)),
@@ -4531,11 +4528,11 @@ class IfLetExpr : public ExprWithBlock
45314528
}
45324529

45334530
// TODO: this mutable getter seems really dodgy. Think up better way.
4534-
const std::vector<std::unique_ptr<Pattern> > &get_patterns () const
4531+
const std::vector<std::unique_ptr<Pattern>> &get_patterns () const
45354532
{
45364533
return match_arm_patterns;
45374534
}
4538-
std::vector<std::unique_ptr<Pattern> > &get_patterns ()
4535+
std::vector<std::unique_ptr<Pattern>> &get_patterns ()
45394536
{
45404537
return match_arm_patterns;
45414538
}
@@ -4575,11 +4572,11 @@ class IfLetExprConseqElse : public IfLetExpr
45754572
public:
45764573
std::string as_string () const override;
45774574

4578-
IfLetExprConseqElse (
4579-
std::vector<std::unique_ptr<Pattern> > match_arm_patterns,
4580-
std::unique_ptr<Expr> value, std::unique_ptr<BlockExpr> if_block,
4581-
std::unique_ptr<ExprWithBlock> else_block,
4582-
std::vector<Attribute> outer_attrs, location_t locus)
4575+
IfLetExprConseqElse (std::vector<std::unique_ptr<Pattern>> match_arm_patterns,
4576+
std::unique_ptr<Expr> value,
4577+
std::unique_ptr<BlockExpr> if_block,
4578+
std::unique_ptr<ExprWithBlock> else_block,
4579+
std::vector<Attribute> outer_attrs, location_t locus)
45834580
: IfLetExpr (std::move (match_arm_patterns), std::move (value),
45844581
std::move (if_block), std::move (outer_attrs), locus),
45854582
else_block (std::move (else_block))
@@ -4632,7 +4629,7 @@ struct MatchArm
46324629
private:
46334630
std::vector<Attribute> outer_attrs;
46344631
// MatchArmPatterns patterns;
4635-
std::vector<std::unique_ptr<Pattern> > match_arm_patterns; // inlined
4632+
std::vector<std::unique_ptr<Pattern>> match_arm_patterns; // inlined
46364633

46374634
// bool has_match_arm_guard;
46384635
// inlined from MatchArmGuard
@@ -4645,7 +4642,7 @@ struct MatchArm
46454642
bool has_match_arm_guard () const { return guard_expr != nullptr; }
46464643

46474644
// Constructor for match arm with a guard expression
4648-
MatchArm (std::vector<std::unique_ptr<Pattern> > match_arm_patterns,
4645+
MatchArm (std::vector<std::unique_ptr<Pattern>> match_arm_patterns,
46494646
location_t locus, std::unique_ptr<Expr> guard_expr = nullptr,
46504647
std::vector<Attribute> outer_attrs = std::vector<Attribute> ())
46514648
: outer_attrs (std::move (outer_attrs)),
@@ -4697,7 +4694,7 @@ struct MatchArm
46974694
static MatchArm create_error ()
46984695
{
46994696
location_t locus = UNDEF_LOCATION;
4700-
return MatchArm (std::vector<std::unique_ptr<Pattern> > (), locus);
4697+
return MatchArm (std::vector<std::unique_ptr<Pattern>> (), locus);
47014698
}
47024699

47034700
std::string as_string () const;
@@ -4719,11 +4716,11 @@ struct MatchArm
47194716
const std::vector<Attribute> &get_outer_attrs () const { return outer_attrs; }
47204717
std::vector<Attribute> &get_outer_attrs () { return outer_attrs; }
47214718

4722-
const std::vector<std::unique_ptr<Pattern> > &get_patterns () const
4719+
const std::vector<std::unique_ptr<Pattern>> &get_patterns () const
47234720
{
47244721
return match_arm_patterns;
47254722
}
4726-
std::vector<std::unique_ptr<Pattern> > &get_patterns ()
4723+
std::vector<std::unique_ptr<Pattern>> &get_patterns ()
47274724
{
47284725
return match_arm_patterns;
47294726
}

0 commit comments

Comments
 (0)