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

[E0769] Use of struct or tuple variant in struct or struct variant #2564

Merged
merged 1 commit into from
Aug 31, 2023

Conversation

MahadMuhammad
Copy link
Contributor

Expected struct variant, found tuple struct/variant - E0769

A tuple struct or tuple variant was used in a pattern as if it were a struct or struct variant.

Code tested:

/home/mahad/Desktop/mahad/gccrs/gcc/testsuite/rust/compile/match4.rs:12:9: error: tuple variant ‘C’ written as struct variant [E0769]
   12 |         Foo::C { a } => {}
      |         ^~~
      |         use the tuple variant pattern syntax instead C(_)

gcc/rust/ChangeLog:

* typecheck/rust-hir-type-check-pattern.cc (TypeCheckPattern::visit): Added error code and rich location.

gcc/testsuite/ChangeLog:

* rust/compile/match4.rs: Updated new error commment.

gcc/rust/ChangeLog:

	* typecheck/rust-hir-type-check-pattern.cc (TypeCheckPattern::visit):
	Added error code and rich location.

gcc/testsuite/ChangeLog:

	* rust/compile/match4.rs:
	Updated new error commment.

Signed-off-by: Muhammad Mahad <mahadtxt@gmail.com>
@philberty philberty added the diagnostic diagnostic static analysis label Aug 28, 2023
@philberty philberty added this to the GCC 14 Stage 3 milestone Aug 28, 2023
@philberty philberty added this pull request to the merge queue Aug 28, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Aug 28, 2023
@CohenArthur CohenArthur added this pull request to the merge queue Aug 29, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Aug 29, 2023
@CohenArthur CohenArthur added this pull request to the merge queue Aug 29, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Aug 29, 2023
@P-E-P P-E-P added this pull request to the merge queue Aug 30, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Aug 30, 2023
@philberty philberty added this pull request to the merge queue Aug 30, 2023
Merged via the queue into Rust-GCC:master with commit 1c4f312 Aug 31, 2023
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
diagnostic diagnostic static analysis
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants