-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Accept TyError
in patterns to avoid ICE on bad input
#51696
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
@@ -505,7 +505,16 @@ impl<'a, 'tcx> PatternContext<'a, 'tcx> { | |||
let def = self.tables.qpath_def(qpath, pat.hir_id); |
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.
I think it might be less fragile to check at the assignment of the tables field, whether tables.tainted_by_errors
is true and then just not recurse.
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.
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.
Hmm no. You're right. your original thing seemed better. I thought we could check before calling from_hir
or new
, but I just checked and that seems messy.
r=me with your original thing
This comment has been minimized.
This comment has been minimized.
There's a discrepancy in regular output and
The warning appears only in the latter. This is true in current stable too. |
@bors r=oli-obk rollup |
📌 Commit fe5710a has been approved by |
Accept `TyError` in patterns to avoid ICE on bad input Fix #50585.
☀️ Test successful - status-appveyor, status-travis |
Don't ICE when performing `lower_pattern_unadjusted` on a `TyError` Fix rust-lang#50577. CC rust-lang#51696. r? @oli-obk
Fix #50585.