Skip to content

Avoid ICE on type error recovery #86764

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
Jul 27, 2021
Merged

Conversation

estebank
Copy link
Contributor

Fix #86756

@rust-highfive
Copy link
Contributor

r? @matthewjasper

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 30, 2021
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@estebank
Copy link
Contributor Author

estebank commented Jul 7, 2021

r? @pnkfelix

@JohnCSimon JohnCSimon added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 25, 2021
@@ -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(),
Copy link
Member

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?

Copy link
Contributor Author

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.

@pnkfelix
Copy link
Member

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Jul 27, 2021

📌 Commit 8ea5362 has been approved by pnkfelix

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 27, 2021
JohnTitor added a commit to JohnTitor/rust that referenced this pull request Jul 27, 2021
bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 27, 2021
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
@bors bors merged commit 4e1ebf2 into rust-lang:master Jul 27, 2021
@rustbot rustbot added this to the 1.56.0 milestone Jul 27, 2021
@estebank estebank deleted the issue-86756 branch November 9, 2023 05:15
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ICE: compiler/rustc_middle/src/ty/subst.rs:538:17: type parameter T/#2 (T/2) out of range when substituting, substs=[FreshTy(0), [type error]]
8 participants