Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust methods for TuplePatternItems to match TupleStructItems #2643

Merged
merged 1 commit into from
Oct 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gcc/rust/backend/rust-compile-expr.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1038,7 +1038,7 @@ sort_tuple_patterns (HIR::MatchExpr &expr)

auto items
= HIR::TuplePattern (ref).get_items ()->clone_tuple_pattern_items ();
if (items->get_pattern_type ()
if (items->get_item_type ()
== HIR::TuplePatternItems::TuplePatternItemType::MULTIPLE)
{
auto items_ref
Expand Down
2 changes: 1 addition & 1 deletion gcc/rust/backend/rust-compile-pattern.cc
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ CompilePatternLet::visit (HIR::TuplePattern &pattern)
tree access_expr = Backend::var_expression (tmp_var, pattern.get_locus ());
ctx->add_statement (init_stmt);

switch (pattern.get_items ()->get_pattern_type ())
switch (pattern.get_items ()->get_item_type ())
{
case HIR::TuplePatternItems::TuplePatternItemType::RANGED: {
size_t tuple_idx = 0;
Expand Down
6 changes: 3 additions & 3 deletions gcc/rust/hir/tree/rust-hir-pattern.h
Original file line number Diff line number Diff line change
Expand Up @@ -1033,7 +1033,7 @@ class TuplePatternItems : public FullVisitable

virtual std::string as_string () const = 0;

virtual TuplePatternItemType get_pattern_type () const = 0;
virtual TuplePatternItemType get_item_type () const = 0;

protected:
// pure virtual clone implementation
Expand Down Expand Up @@ -1078,7 +1078,7 @@ class TuplePatternItemsMultiple : public TuplePatternItems

void accept_vis (HIRFullVisitor &vis) override;

TuplePatternItemType get_pattern_type () const override
TuplePatternItemType get_item_type () const override
{
return TuplePatternItemType::MULTIPLE;
}
Expand Down Expand Up @@ -1148,7 +1148,7 @@ class TuplePatternItemsRanged : public TuplePatternItems

void accept_vis (HIRFullVisitor &vis) override;

TuplePatternItemType get_pattern_type () const override
TuplePatternItemType get_item_type () const override
{
return TuplePatternItemType::RANGED;
}
Expand Down
2 changes: 1 addition & 1 deletion gcc/rust/typecheck/rust-hir-type-check-pattern.cc
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ void
TypeCheckPattern::visit (HIR::TuplePattern &pattern)
{
std::unique_ptr<HIR::TuplePatternItems> items;
switch (pattern.get_items ()->get_pattern_type ())
switch (pattern.get_items ()->get_item_type ())
{
case HIR::TuplePatternItems::TuplePatternItemType::MULTIPLE: {
HIR::TuplePatternItemsMultiple &ref
Expand Down