Skip to content
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

delay the bug when read immediate #137806

Closed
wants to merge 1 commit into from

Conversation

mu001999
Copy link
Contributor

Fixes #137656

Fixes ICE during the const evaluation after SelectionError::ConstArgHasWrongType was already captured.
Delays the bug to prioritize emitting the caught type error, preventing the crash.

@rustbot
Copy link
Collaborator

rustbot commented Feb 28, 2025

r? @nnethercote

rustbot has assigned @nnethercote.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@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 Feb 28, 2025
@rustbot
Copy link
Collaborator

rustbot commented Feb 28, 2025

Some changes occurred to the CTFE / Miri interpreter

cc @rust-lang/miri

Some changes occurred to the CTFE machinery

cc @rust-lang/wg-const-eval

@RalfJung
Copy link
Member

RalfJung commented Feb 28, 2025

This is unfortunately not the right fix. The right fix is to not even try to evaluate MIR that contains type errors.

We will never be able to squash all the ICEs that invalid MIR can cause in the interpreter.

@mu001999
Copy link
Contributor Author

@RalfJung I initially wanted to break early when process_obligation returned the mismatched type error, but it's limited in rustc_data_structures

@compiler-errors
Copy link
Member

Yeah, this is not the right fix. I'll try to write up a comment in the issue.

@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 Feb 28, 2025
@mu001999
Copy link
Contributor Author

I think I should close this

@mu001999 mu001999 closed this Feb 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. 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: primitive read not possible for type: fn(usize) -> bool {not_one}
5 participants