-
Notifications
You must be signed in to change notification settings - Fork 162
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
Fatal Error: used more than once - [E0062] #2381
Labels
Comments
Would it be ok for me to pick this up? |
robertgoss
added a commit
to robertgoss/gccrs
that referenced
this issue
Jan 16, 2024
Fixes Rust-GCC#2381 If a struct type is initialized with one of it's fields repeated it will currently issue an error at the use site. However we would like to give the rust error code and (like rustc) show both the specifications for the field to help the user diagnose the issue. We move the check after the index for the field has been established so we can look up if the field has already been defined and get it's location. We update the visit method to return if it has handled an error otherwise we then output a second fatal error as not all the field in the specification have been processed. gcc/rust/ChangeLog: * typecheck/rust-hir-type-check-struct-field.h: Allow visit to return a bool * typecheck/rust-hir-type-check-struct-field.cc: Improve check of respecification of fields gcc/testsuite/ChangeLog: * rust/compile/repeated_constructor_fields.r: Added case with fields in constructor repeated Signed-off-by: Robert Goss <goss.robert@gmail.com>
robertgoss
added a commit
to robertgoss/gccrs
that referenced
this issue
Jan 16, 2024
Fixes Rust-GCC#2381 If a struct type is initialized with one of it's fields repeated it will currently issue an error at the use site. However we would like to give the rust error code and (like rustc) show both the specifications for the field to help the user diagnose the issue. We move the check after the index for the field has been established so we can look up if the field has already been defined and get it's location. We update the visit method to return if it has handled an error otherwise we then output a second fatal error as not all the field in the specification have been processed. gcc/rust/ChangeLog: * typecheck/rust-hir-type-check-struct-field.h: Allow visit to return a bool * typecheck/rust-hir-type-check-struct-field.cc: Improve check of respecification of fields gcc/testsuite/ChangeLog: * rust/compile/repeated_constructor_fields.r: Added case with fields in constructor repeated Signed-off-by: Robert Goss <goss.robert@gmail.com>
robertgoss
added a commit
to robertgoss/gccrs
that referenced
this issue
Jan 16, 2024
Fixes Rust-GCC#2381 If a struct type is initialized with one of it's fields repeated it will currently issue an error at the use site. However we would like to give the rust error code and (like rustc) show both the specifications for the field to help the user diagnose the issue. We move the check after the index for the field has been established so we can look up if the field has already been defined and get it's location. We update the visit method to return if it has handled an error otherwise we then output a second fatal error as not all the field in the specification have been processed. gcc/rust/ChangeLog: * typecheck/rust-hir-type-check-struct-field.h: Allow visit to return a bool * typecheck/rust-hir-type-check-struct-field.cc: Improve check of respecification of fields gcc/testsuite/ChangeLog: * rust/compile/repeated_constructor_fields.r: Added case with fields in constructor repeated Signed-off-by: Robert Goss <goss.robert@gmail.com>
robertgoss
added a commit
to robertgoss/gccrs
that referenced
this issue
Jan 16, 2024
Fixes Rust-GCC#2381 If a struct type is initialized with one of it's fields repeated it will currently issue an error at the use site. However we would like to give the rust error code and (like rustc) show both the specifications for the field to help the user diagnose the issue. We move the check after the index for the field has been established so we can look up if the field has already been defined and get it's location. We update the visit method to return if it has handled an error otherwise we then output a second fatal error as not all the field in the specification have been processed. gcc/rust/ChangeLog: * typecheck/rust-hir-type-check-struct-field.h: Allow visit to return a bool * typecheck/rust-hir-type-check-struct-field.cc: Improve check of respecification of fields gcc/testsuite/ChangeLog: * rust/compile/repeated_constructor_fields.rs: Added case with fields in constructor repeated Signed-off-by: Robert Goss <goss.robert@gmail.com>
robertgoss
added a commit
to robertgoss/gccrs
that referenced
this issue
Jan 16, 2024
Fixes Rust-GCC#2381 If a struct type is initialized with one of it's fields repeated it will currently issue an error at the use site. However we would like to give the rust error code and (like rustc) show both the specifications for the field to help the user diagnose the issue. We move the check after the index for the field has been established so we can look up if the field has already been defined and get it's location. We update the visit method to return if it has handled an error otherwise we then output a second fatal error as not all the field in the specification have been processed. gcc/rust/ChangeLog: * gcc/rust/typecheck/rust-hir-type-check-struct-field.h: Allow visit to return a bool * gcc/rust/typecheck/rust-hir-type-check-struct-field.cc: Improve check of respecification of fields gcc/testsuite/ChangeLog: * rust/compile/repeated_constructor_fields.rs: Added case with fields in constructor repeated Signed-off-by: Robert Goss <goss.robert@gmail.com>
robertgoss
added a commit
to robertgoss/gccrs
that referenced
this issue
Jan 16, 2024
Fixes Rust-GCC#2381 If a struct type is initialized with one of it's fields repeated it will currently issue an error at the use site. However we would like to give the rust error code and (like rustc) show both the specifications for the field to help the user diagnose the issue. We move the check after the index for the field has been established so we can look up if the field has already been defined and get it's location. We update the visit method to return if it has handled an error otherwise we then output a second fatal error as not all the field in the specification have been processed. gcc/rust/ChangeLog: * gcc/rust/typecheck/rust-hir-type-check-struct-field.h: Allow visit to return a bool * gcc/rust/typecheck/rust-hir-type-check-struct-field.cc: Improve check of repeat fields gcc/testsuite/ChangeLog: * rust/compile/repeated_constructor_fields.rs: Added case with constructor field repeated Signed-off-by: Robert Goss <goss.robert@gmail.com>
robertgoss
added a commit
to robertgoss/gccrs
that referenced
this issue
Jan 16, 2024
Fixes Rust-GCC#2381 If a struct type is initialized with one of it's fields repeated it will currently issue an error at the use site. However we would like to give the rust error code and (like rustc) show both the specifications for the field to help the user diagnose the issue. We move the check after the index for the field has been established so we can look up if the field has already been defined and get it's location. We update the visit method to return if it has handled an error otherwise we then output a second fatal error as not all the field in the specification have been processed. gcc/rust/ChangeLog: * typecheck/rust-hir-type-check-struct-field.h: Allow visit to return a bool * typecheck/rust-hir-type-check-struct.cc: Improve check of repeat fields gcc/testsuite/ChangeLog: * rust/compile/repeated_constructor_fields.rs: Added case with constructor field repeated Signed-off-by: Robert Goss <goss.robert@gmail.com>
robertgoss
added a commit
to robertgoss/gccrs
that referenced
this issue
Jan 17, 2024
Fixes Rust-GCC#2381 If a struct type is initialized with one of it's fields repeated it will currently issue an error at the use site. However we would like to give the rust error code and (like rustc) show both the specifications for the field to help the user diagnose the issue. We move the check after the index for the field has been established so we can look up if the field has already been defined and get it's location. We update the visit method to return if it has handled an error otherwise we then output a second fatal error as not all the field in the specification have been processed. gcc/rust/ChangeLog: * typecheck/rust-hir-type-check-struct-field.h: Allow visit to return a bool * typecheck/rust-hir-type-check-struct.cc: Improve check of repeat fields gcc/testsuite/ChangeLog: * rust/compile/repeated_constructor_fields.rs: Added case with constructor field repeated Signed-off-by: Robert Goss <goss.robert@gmail.com>
github-merge-queue bot
pushed a commit
that referenced
this issue
Jan 18, 2024
Fixes #2381 If a struct type is initialized with one of it's fields repeated it will currently issue an error at the use site. However we would like to give the rust error code and (like rustc) show both the specifications for the field to help the user diagnose the issue. We move the check after the index for the field has been established so we can look up if the field has already been defined and get it's location. We update the visit method to return if it has handled an error otherwise we then output a second fatal error as not all the field in the specification have been processed. gcc/rust/ChangeLog: * typecheck/rust-hir-type-check-struct-field.h: Allow visit to return a bool * typecheck/rust-hir-type-check-struct.cc: Improve check of repeat fields gcc/testsuite/ChangeLog: * rust/compile/repeated_constructor_fields.rs: Added case with constructor field repeated Signed-off-by: Robert Goss <goss.robert@gmail.com>
CohenArthur
pushed a commit
to CohenArthur/gccrs
that referenced
this issue
Jan 26, 2024
Fixes Rust-GCC#2381 If a struct type is initialized with one of it's fields repeated it will currently issue an error at the use site. However we would like to give the rust error code and (like rustc) show both the specifications for the field to help the user diagnose the issue. We move the check after the index for the field has been established so we can look up if the field has already been defined and get it's location. We update the visit method to return if it has handled an error otherwise we then output a second fatal error as not all the field in the specification have been processed. gcc/rust/ChangeLog: * typecheck/rust-hir-type-check-struct-field.h: Allow visit to return a bool * typecheck/rust-hir-type-check-struct.cc: Improve check of repeat fields gcc/testsuite/ChangeLog: * rust/compile/repeated_constructor_fields.rs: Added case with constructor field repeated Signed-off-by: Robert Goss <goss.robert@gmail.com>
CohenArthur
pushed a commit
to CohenArthur/gccrs
that referenced
this issue
Jan 26, 2024
…ructor Fixes Rust-GCC#2381 If a struct type is initialized with one of it's fields repeated it will currently issue an error at the use site. However we would like to give the rust error code and (like rustc) show both the specifications for the field to help the user diagnose the issue. We move the check after the index for the field has been established so we can look up if the field has already been defined and get it's location. We update the visit method to return if it has handled an error otherwise we then output a second fatal error as not all the field in the specification have been processed. gcc/rust/ChangeLog: * typecheck/rust-hir-type-check-struct-field.h: Allow visit to return a bool * typecheck/rust-hir-type-check-struct.cc: Improve check of repeat fields gcc/testsuite/ChangeLog: * rust/compile/repeated_constructor_fields.rs: Added case with constructor field repeated Signed-off-by: Robert Goss <goss.robert@gmail.com>
CohenArthur
pushed a commit
to CohenArthur/gccrs
that referenced
this issue
Feb 5, 2024
…ructor Fixes Rust-GCC#2381 If a struct type is initialized with one of it's fields repeated it will currently issue an error at the use site. However we would like to give the rust error code and (like rustc) show both the specifications for the field to help the user diagnose the issue. We move the check after the index for the field has been established so we can look up if the field has already been defined and get it's location. We update the visit method to return if it has handled an error otherwise we then output a second fatal error as not all the field in the specification have been processed. gcc/rust/ChangeLog: * typecheck/rust-hir-type-check-struct-field.h: Allow visit to return a bool * typecheck/rust-hir-type-check-struct.cc: Improve check of repeat fields gcc/testsuite/ChangeLog: * rust/compile/repeated_constructor_fields.rs: Added case with constructor field repeated Signed-off-by: Robert Goss <goss.robert@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Fatal Error -
used more than once
I tried this code from E0062:
I expected to see this happen:
Instead, this happened:
Meta
gccrs (Compiler-Explorer-Build-gcc-2f91d511200bf85558c9013b09a458c06edd1e02-binutils-2.40) 13.0.1 20230417 (experimental)
The text was updated successfully, but these errors were encountered: