aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/hir/rust-ast-lower-base.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/rust/hir/rust-ast-lower-base.cc')
-rw-r--r--gcc/rust/hir/rust-ast-lower-base.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/rust/hir/rust-ast-lower-base.cc b/gcc/rust/hir/rust-ast-lower-base.cc
index d1bc05b..82d1d2c 100644
--- a/gcc/rust/hir/rust-ast-lower-base.cc
+++ b/gcc/rust/hir/rust-ast-lower-base.cc
@@ -675,12 +675,14 @@ struct_field_name_exists (std::vector<HIR::StructField> &fields,
{
for (auto &field : fields)
{
- if (field.get_field_name ().compare (new_field.get_field_name ()) == 0)
+ if (field.get_field_name ().as_string ().compare (
+ new_field.get_field_name ().as_string ())
+ == 0)
{
RichLocation r (new_field.get_locus ());
r.add_range (field.get_locus ());
rust_error_at (r, "duplicate field name %qs",
- field.get_field_name ().c_str ());
+ field.get_field_name ().as_string ().c_str ());
return true;
}
}