mirror of
https://github.com/gcc-mirror/gcc.git
synced 2026-05-06 14:59:39 +02:00
gccrs: Fix test same_field_name.rs
gcc/rust/ChangeLog: * hir/rust-ast-lower-item.cc (ASTLoweringItem::visit): Keep going after a duplicate field is found. gcc/testsuite/ChangeLog: * rust/execute/same_field_name.rs: Move to... * rust/compile/same_field_name.rs: ...here and adjust expected errors. Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
This commit is contained in:
@@ -217,7 +217,7 @@ ASTLoweringItem::visit (AST::StructStruct &struct_decl)
|
||||
field.get_outer_attrs ());
|
||||
|
||||
if (struct_field_name_exists (fields, translated_field))
|
||||
break;
|
||||
continue;
|
||||
|
||||
fields.push_back (std::move (translated_field));
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// https://doc.rust-lang.org/error_codes/E0124.html
|
||||
fn main() {
|
||||
struct Foo {
|
||||
field1: i32, // { dg-error "field .field1. is already declared" }
|
||||
field1: i32,
|
||||
field1: i32, // { dg-error "field .field1. is already declared" }
|
||||
field1: i32, // { dg-error "field .field1. is already declared" }
|
||||
}
|
||||
Reference in New Issue
Block a user