Skip to content

Exhaustiveness: abort on type error #119715

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 4 commits into from
Jan 11, 2024
Merged

Conversation

Nadrieril
Copy link
Member

@Nadrieril Nadrieril commented Jan 7, 2024

This adds an error path to exhaustiveness checking so that we abort instead of ICEing when encountering a stray ty::Error.

Fixes #119493
Fixes #119778

r? @compiler-errors

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jan 7, 2024
@compiler-errors
Copy link
Member

one nit, one question

@rustbot author

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 9, 2024
Co-authored-by: Michael Goulet <michael@errs.io>
@Nadrieril
Copy link
Member Author

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jan 9, 2024
@compiler-errors
Copy link
Member

@bors r+

@bors
Copy link
Collaborator

bors commented Jan 9, 2024

📌 Commit 0112270 has been approved by compiler-errors

It is now in the queue for this repository.

@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 Jan 9, 2024
@compiler-errors
Copy link
Member

@bors r-

let's leave this until can test that other ICE

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jan 9, 2024
@Nadrieril Nadrieril force-pushed the graceful-type-error branch from 0112270 to dee657f Compare January 10, 2024 13:51
@Nadrieril
Copy link
Member Author

Alright, the issue is that typeck's use of ty::Error is not as consistent as I'd hoped: in #119778 the type of the field of Foo is [u8; {error}] instead of being {error} directly as I'd hoped. So I'm going back to ty.error_reported().

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jan 10, 2024
@compiler-errors
Copy link
Member

@bors r+

@bors
Copy link
Collaborator

bors commented Jan 10, 2024

📌 Commit dee657f has been approved by compiler-errors

It is now in the queue for this repository.

@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 Jan 10, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 11, 2024
…iaskrgr

Rollup of 11 pull requests

Successful merges:

 - rust-lang#115046 (Use version-sorting for all sorting)
 - rust-lang#118915 (Add some comments, add `can_define_opaque_ty` check to `try_normalize_ty_recur`)
 - rust-lang#119006 (Fix is_global special address handling)
 - rust-lang#119637 (Pass LLVM error message back to pass wrapper.)
 - rust-lang#119715 (Exhaustiveness: abort on type error)
 - rust-lang#119763 (Cleanup things in and around `Diagnostic`)
 - rust-lang#119788 (change function name in comments)
 - rust-lang#119790 (Fix all_trait* methods to return all traits available in StableMIR)
 - rust-lang#119803 (Silence some follow-up errors [1/x])
 - rust-lang#119804 (Stabilize mutex_unpoison feature)
 - rust-lang#119832 (Meta: Add project const traits to triagebot config)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 4dcc5a0 into rust-lang:master Jan 11, 2024
@rustbot rustbot added this to the 1.77.0 milestone Jan 11, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Jan 11, 2024
Rollup merge of rust-lang#119715 - Nadrieril:graceful-type-error, r=compiler-errors

Exhaustiveness: abort on type error

This adds an error path to exhaustiveness checking so that we abort instead of ICEing when encountering a stray `ty::Error`.

Fixes rust-lang#119493
Fixes rust-lang#119778

r? `@compiler-errors`
@Nadrieril Nadrieril deleted the graceful-type-error branch January 11, 2024 08:24
# 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. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ICE: None in compiler/rustc_pattern_analysis/src/constructor.rs ICE: Unexpected type for constructor
4 participants