-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Avoid ICE on type error recovery #86764
Conversation
(rust-highfive has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
r? @pnkfelix |
@@ -488,12 +488,20 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o { | |||
tcx.ty_error().into() | |||
} else { | |||
// This is a default type parameter. | |||
let substs = substs.unwrap(); | |||
if substs.iter().any(|arg| match arg.unpack() { | |||
GenericArgKind::Type(ty) => ty.references_error(), |
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 don't object to this code here, but I did wonder: does this pattern (of iterating over the substs looking for evidence of a type error recovery) occur elsewhere? Does it deserve its own helper routine on substs
?
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 do not expect this pattern to be common in the codebase.
@bors r+ rollup |
📌 Commit 8ea5362 has been approved by |
Avoid ICE on type error recovery Fix rust-lang#86756
Rollup of 10 pull requests Successful merges: - rust-lang#86450 (Add flag to configure `large_assignments` lint) - rust-lang#86764 (Avoid ICE on type error recovery) - rust-lang#87354 (Update VxWork's UNIX support) - rust-lang#87427 (get rid of NoMirFor error variant) - rust-lang#87446 (macos current_exe using directly libc instead.) - rust-lang#87494 (fix typo: whenver -> whenever) - rust-lang#87497 (Add long explanation for E0544.) - rust-lang#87499 (Remove ASCII fast path from `rustc_lexer::{is_id_continue, is_id_start}`) - rust-lang#87502 (Update cargo) - rust-lang#87503 (Update books) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Fix #86756