-
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
[E0164] Neither tuple struct nor tuple variant used as a pattern #2565
Conversation
Checking if pattern has items, before returing solves ICE. Added error code and rich location. Also, fixes Rust-GCC#2430 gcc/rust/ChangeLog: * ast/rust-pattern.h: No need of assertion, we are handling it. * resolve/rust-early-name-resolver.cc (EarlyNameResolver::visit): Added check which emits error instead of using assertion. * typecheck/rust-hir-type-check-pattern.cc (TypeCheckPattern::visit): Added rich location and error code. gcc/testsuite/ChangeLog: * rust/compile/match5.rs: Updated comment for dejagnu. * rust/compile/pattern-struct.rs: New test for ICE. Signed-off-by: Muhammad Mahad <mahadtxt@gmail.com>
rust_error_at ( | ||
pattern.get_locus (), | ||
rich_locus, ErrorCode::E0164, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here, rustc 1.49.0 emits E0532
& rustc 1.71.0 emits E0164
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. Go with the latest one
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added the latest one :)
rust_assert (has_items ()); | ||
return items; | ||
} | ||
std::unique_ptr<TupleStructItems> &get_items () { return items; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good find @dkm has been fixing these too. Keep your eye out for them :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Neither a tuple struct nor a tuple variant was used as a pattern -
E0164
Checking if pattern has items, before returing solves ICE. Added error code and rich location.
gcc/rust/ChangeLog:
gcc/testsuite/ChangeLog: