-
Notifications
You must be signed in to change notification settings - Fork 170
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
Expected tuple struct or tuple variant, found struct variant [E0532] #2324
Labels
Milestone
Comments
liamnaddell
added a commit
to liamnaddell/gccrs
that referenced
this issue
Aug 3, 2024
… arm and invalid match arm
liamnaddell
added a commit
to liamnaddell/gccrs
that referenced
this issue
Aug 4, 2024
gcc/rust/ChangeLog: * backend/rust-compile-expr.cc: remove assert to allow for 0 variants in ADT * backend/rust-compile-pattern.cc: Add check for trying to reference tuple or struct AST variant using simple path * backend/rust-compile-pattern.h: add checker function for E0532 to header gcc/testsuite/ChangeLog: * rust/compile/issue-2324.rs: add test for E0532 Signed-off-by: Liam Naddell <liam.naddell@mail.utoronto.ca>
liamnaddell
added a commit
to liamnaddell/gccrs
that referenced
this issue
Aug 4, 2024
gcc/rust/ChangeLog: * backend/rust-compile-expr.cc: remove assert to allow for 0 variants in ADT * backend/rust-compile-pattern.cc: Add check for trying to reference tuple or struct AST variant using simple path * backend/rust-compile-pattern.h: add checker function for E0532 to header gcc/testsuite/ChangeLog: * rust/compile/issue-2324.rs: add test for E0532 Signed-off-by: Liam Naddell <liam.naddell@mail.utoronto.ca>
liamnaddell
added a commit
to liamnaddell/gccrs
that referenced
this issue
Aug 4, 2024
gcc/rust/ChangeLog: * typecheck/rust-hir-type-check-pattern.cc: Emit E0532 when trying to reference a Tuple or Struct variant using a non Tuple or Struct pattern. gcc/testsuite/ChangeLog: * rust/compile/issue-2324.rs: add test for E0532 Signed-off-by: Liam Naddell <liam.naddell@mail.utoronto.ca>
liamnaddell
added a commit
to liamnaddell/gccrs
that referenced
this issue
Aug 4, 2024
gcc/rust/ChangeLog: * typecheck/rust-hir-type-check-pattern.cc: Emit E0532 when trying to reference a Tuple or Struct variant using a non Tuple or Struct pattern. gcc/testsuite/ChangeLog: * rust/compile/issue-2324.rs: add test for E0532 Signed-off-by: Liam Naddell <liam.naddell@mail.utoronto.ca>
liamnaddell
added a commit
to liamnaddell/gccrs
that referenced
this issue
Aug 4, 2024
gcc/rust/ChangeLog: * typecheck/rust-hir-type-check-pattern.cc: Emit E0532 when trying to reference a Tuple or Struct variant using a non Tuple or Struct pattern. gcc/testsuite/ChangeLog: * rust/compile/issue-2324-1.rs: add test for E0532 with tuple enum variant * rust/compile/issue-2324-1.rs: add test for E0532 with struct enum variant Signed-off-by: Liam Naddell <liam.naddell@mail.utoronto.ca>
liamnaddell
added a commit
to liamnaddell/gccrs
that referenced
this issue
Aug 4, 2024
gcc/rust/ChangeLog: * typecheck/rust-hir-type-check-pattern.cc: Emit E0532 when trying to reference a Tuple or Struct variant using a non Tuple or Struct pattern. gcc/testsuite/ChangeLog: * rust/compile/issue-2324-1.rs: add test for E0532 with tuple enum variant * rust/compile/issue-2324-1.rs: add test for E0532 with struct enum variant Signed-off-by: Liam Naddell <liam.naddell@mail.utoronto.ca>
liamnaddell
added a commit
to liamnaddell/gccrs
that referenced
this issue
Aug 4, 2024
gcc/rust/ChangeLog: * typecheck/rust-hir-type-check-pattern.cc: Emit E0532 when trying to reference a Tuple or Struct variant using a non Tuple or Struct pattern. gcc/testsuite/ChangeLog: * rust/compile/issue-2324-1.rs: add test for E0532 with tuple enum variant * rust/compile/issue-2324-2.rs: add test for E0532 with struct enum variant Signed-off-by: Liam Naddell <liam.naddell@mail.utoronto.ca>
liamnaddell
added a commit
to liamnaddell/gccrs
that referenced
this issue
Aug 4, 2024
gcc/rust/ChangeLog: * typecheck/rust-hir-type-check-pattern.cc: Emit E0532 when trying to reference a Tuple or Struct variant using a non Tuple or Struct pattern. gcc/testsuite/ChangeLog: * rust/compile/issue-2324-1.rs: add test for E0532 with tuple enum variant * rust/compile/issue-2324-2.rs: add test for E0532 with struct enum variant Signed-off-by: Liam Naddell <liam.naddell@mail.utoronto.ca>
github-merge-queue bot
pushed a commit
that referenced
this issue
Aug 6, 2024
gcc/rust/ChangeLog: * typecheck/rust-hir-type-check-pattern.cc: Emit E0532 when trying to reference a Tuple or Struct variant using a non Tuple or Struct pattern. gcc/testsuite/ChangeLog: * rust/compile/issue-2324-1.rs: add test for E0532 with tuple enum variant * rust/compile/issue-2324-2.rs: add test for E0532 with struct enum variant Signed-off-by: Liam Naddell <liam.naddell@mail.utoronto.ca>
tschwinge
pushed a commit
that referenced
this issue
Dec 4, 2024
gcc/rust/ChangeLog: * typecheck/rust-hir-type-check-pattern.cc: Emit E0532 when trying to reference a Tuple or Struct variant using a non Tuple or Struct pattern. gcc/testsuite/ChangeLog: * rust/compile/issue-2324-1.rs: add test for E0532 with tuple enum variant * rust/compile/issue-2324-2.rs: add test for E0532 with struct enum variant Signed-off-by: Liam Naddell <liam.naddell@mail.utoronto.ca>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I tried this code:
E0532
error, Arm Does Not Match Expected Kind - expected tuple struct or tuple variant, found struct variant.I expected to see this happen:
Abort due to
E0532
errorInstead, this happened:
Compiled with warning
Meta
The text was updated successfully, but these errors were encountered: