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

Skipping user args when PatKind::Error in Pat lower_variant_or_leaf #138258

Closed
wants to merge 1 commit into from

Conversation

xizheyin
Copy link
Contributor

@xizheyin xizheyin commented Mar 9, 2025

Fixes #138048

Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
@rustbot
Copy link
Collaborator

rustbot commented Mar 9, 2025

r? @BoxyUwU

rustbot has assigned @BoxyUwU.
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
Copy link
Collaborator

rustbot commented Mar 9, 2025

Some changes occurred in match checking

cc @Nadrieril

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

compiler-errors commented Mar 9, 2025

I'm somewhat confused why this is dependent on the existence of a lifetime parameter. It suggests that there may be something deeper going on here.

Do you know why this regressed in #137617? I think simply suppressing the error may be the wrong choice here if we don't understand why it was happening in the first place.

@xizheyin
Copy link
Contributor Author

xizheyin commented Mar 9, 2025

Fair enough. As I understand it, this ICE seems to be an error logic originating from lower_variant_or_leaf. It seems that after an error is encountered when lower V is encountered, it should just return PatKind::Error. @compiler-errors

@compiler-errors
Copy link
Member

I have an alternative fix in #138284.

Sorry that this is the second time this has happened (cc #138219 (comment)) -- maybe I recommend finding a much smaller issue as a first contribution so that the fix doesn't need to be so non-trivial, since these type system bugs involving consts are usually not easy to fix 😅

@xizheyin
Copy link
Contributor Author

Oh! It seems that I underestimated the difficulty of repairing this problem. Do you have any suggestions on where to start the repair of ice? At present, the two ices I have chosen are both nontrivial. @compiler-errors

@xizheyin xizheyin closed this Mar 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ICE when using a constant as a pattern
4 participants