aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/resolve/rust-ast-resolve-stmt.h
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/rust/resolve/rust-ast-resolve-stmt.h')
-rw-r--r--gcc/rust/resolve/rust-ast-resolve-stmt.h48
1 files changed, 21 insertions, 27 deletions
diff --git a/gcc/rust/resolve/rust-ast-resolve-stmt.h b/gcc/rust/resolve/rust-ast-resolve-stmt.h
index 6dfac91..d3ff14f 100644
--- a/gcc/rust/resolve/rust-ast-resolve-stmt.h
+++ b/gcc/rust/resolve/rust-ast-resolve-stmt.h
@@ -63,7 +63,7 @@ public:
[&] (const CanonicalPath &, NodeId, location_t locus) -> void {
rich_location r (line_table, constant.get_locus ());
r.add_range (locus);
- rust_error_at (r, "redefined multiple times");
+ rust_error_at (r, "defined multiple times");
});
ResolveType::go (constant.get_type ());
@@ -97,17 +97,15 @@ public:
[&] (const CanonicalPath &, NodeId, location_t locus) -> void {
rich_location r (line_table, struct_decl.get_locus ());
r.add_range (locus);
- rust_error_at (r, "redefined multiple times");
+ rust_error_at (r, "defined multiple times");
});
NodeId scope_node_id = struct_decl.get_node_id ();
resolver->get_type_scope ().push (scope_node_id);
if (struct_decl.has_generics ())
- {
- for (auto &generic : struct_decl.get_generic_params ())
- ResolveGenericParam::go (*generic, prefix, canonical_prefix);
- }
+ ResolveGenericParams::go (struct_decl.get_generic_params (), prefix,
+ canonical_prefix);
for (AST::TupleField &field : struct_decl.get_fields ())
ResolveType::go (field.get_field_type ());
@@ -130,17 +128,15 @@ public:
[&] (const CanonicalPath &, NodeId, location_t locus) -> void {
rich_location r (line_table, enum_decl.get_locus ());
r.add_range (locus);
- rust_error_at (r, "redefined multiple times");
+ rust_error_at (r, "defined multiple times");
});
NodeId scope_node_id = enum_decl.get_node_id ();
resolver->get_type_scope ().push (scope_node_id);
if (enum_decl.has_generics ())
- {
- for (auto &generic : enum_decl.get_generic_params ())
- ResolveGenericParam::go (*generic, prefix, canonical_prefix);
- }
+ ResolveGenericParams::go (enum_decl.get_generic_params (), prefix,
+ canonical_prefix);
for (auto &variant : enum_decl.get_variants ())
ResolveStmt::go (*variant, path, canonical_prefix, path);
@@ -162,7 +158,7 @@ public:
[&] (const CanonicalPath &, NodeId, location_t locus) -> void {
rich_location r (line_table, item.get_locus ());
r.add_range (locus);
- rust_error_at (r, "redefined multiple times");
+ rust_error_at (r, "defined multiple times");
});
// Done, no fields.
@@ -182,7 +178,7 @@ public:
[&] (const CanonicalPath &, NodeId, location_t locus) -> void {
rich_location r (line_table, item.get_locus ());
r.add_range (locus);
- rust_error_at (r, "redefined multiple times");
+ rust_error_at (r, "defined multiple times");
});
for (auto &field : item.get_tuple_fields ())
@@ -208,7 +204,7 @@ public:
[&] (const CanonicalPath &, NodeId, location_t locus) -> void {
rich_location r (line_table, item.get_locus ());
r.add_range (locus);
- rust_error_at (r, "redefined multiple times");
+ rust_error_at (r, "defined multiple times");
});
for (auto &field : item.get_struct_fields ())
@@ -234,7 +230,7 @@ public:
[&] (const CanonicalPath &, NodeId, location_t locus) -> void {
rich_location r (line_table, item.get_locus ());
r.add_range (locus);
- rust_error_at (r, "redefined multiple times");
+ rust_error_at (r, "defined multiple times");
});
// Done, no fields.
@@ -255,17 +251,15 @@ public:
[&] (const CanonicalPath &, NodeId, location_t locus) -> void {
rich_location r (line_table, struct_decl.get_locus ());
r.add_range (locus);
- rust_error_at (r, "redefined multiple times");
+ rust_error_at (r, "defined multiple times");
});
NodeId scope_node_id = struct_decl.get_node_id ();
resolver->get_type_scope ().push (scope_node_id);
if (struct_decl.has_generics ())
- {
- for (auto &generic : struct_decl.get_generic_params ())
- ResolveGenericParam::go (*generic, prefix, canonical_prefix);
- }
+ ResolveGenericParams::go (struct_decl.get_generic_params (), prefix,
+ canonical_prefix);
for (AST::StructField &field : struct_decl.get_fields ())
{
@@ -293,15 +287,15 @@ public:
[&] (const CanonicalPath &, NodeId, location_t locus) -> void {
rich_location r (line_table, union_decl.get_locus ());
r.add_range (locus);
- rust_error_at (r, "redefined multiple times");
+ rust_error_at (r, "defined multiple times");
});
NodeId scope_node_id = union_decl.get_node_id ();
resolver->get_type_scope ().push (scope_node_id);
if (union_decl.has_generics ())
- for (auto &generic : union_decl.get_generic_params ())
- ResolveGenericParam::go (*generic, prefix, canonical_prefix);
+ ResolveGenericParams::go (union_decl.get_generic_params (), prefix,
+ canonical_prefix);
for (AST::StructField &field : union_decl.get_variants ())
{
@@ -329,7 +323,7 @@ public:
[&] (const CanonicalPath &, NodeId, location_t locus) -> void {
rich_location r (line_table, function.get_locus ());
r.add_range (locus);
- rust_error_at (r, "redefined multiple times");
+ rust_error_at (r, "defined multiple times");
});
NodeId scope_node_id = function.get_node_id ();
@@ -338,11 +332,11 @@ public:
resolver->get_label_scope ().push (scope_node_id);
resolver->push_new_name_rib (resolver->get_name_scope ().peek ());
resolver->push_new_type_rib (resolver->get_type_scope ().peek ());
- resolver->push_new_label_rib (resolver->get_type_scope ().peek ());
+ resolver->push_new_label_rib (resolver->get_label_scope ().peek ());
if (function.has_generics ())
- for (auto &generic : function.get_generic_params ())
- ResolveGenericParam::go (*generic, prefix, canonical_prefix);
+ ResolveGenericParams::go (function.get_generic_params (), prefix,
+ canonical_prefix);
if (function.has_return_type ())
ResolveType::go (function.get_return_type ());