-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Issue-125323: ICE non-ADT in struct pattern when long time constant evaluation is in for loop #138679
base: master
Are you sure you want to change the base?
Conversation
…report_error When constant evaluation fails, the error is propagated to other places if report_error uses tainted_by_errors. Signed-off-by: Shunpoco <tkngsnsk313320@gmail.com>
Signed-off-by: Shunpoco <tkngsnsk313320@gmail.com>
Signed-off-by: Shunpoco <tkngsnsk313320@gmail.com>
This ty::Error was added in rust-lang#123428, but the root cause is the same as rust-lang#125323. After report_error is fixed, the arm isn't needed anymore. Signed-off-by: Shunpoco <tkngsnsk313320@gmail.com>
This comment has been minimized.
This comment has been minimized.
Signed-off-by: Shunpoco <tkngsnsk313320@gmail.com>
This PR changes a file inside |
I don't believe this is the right solution, because using The real root cause of this issue is this: rust/compiler/rustc_interface/src/passes.rs Lines 991 to 995 in 75530e9
...which causes us to enter r? oli-obk |
Please ensure that after this PR is fully reworked that it's squashed into a single commit. |
Yea errs' analysis is spot on. Skipping the |
This PR fixes #125323
Context
According to the issue, the ICE happens since #121206.
In the PR, some error methods were reorganized. For example, has_errors() was renamed to has_errors_exclude_lint_errors(). However, some codes which used the original has_errors() were not switched to has_errors_exclude_lint_errors(). I finally found that report_error() in writeback.rs causes this ICE. Currently the method uses tainted_by_errors() to get guar (ErrorGuaranteed), but originally it used dcx().has_errors() but it wasn't changed to has_errors_exclude_lint_errors() when changes in #121206 were merged. I don't think I fully understand how an error is propagated, but I suppose that the error from long time constant evaluation is unexpectedly propagated other parts (in this ICE, for loop), then cause the non-ADT in struct pattern ICE.
Change
NOTE
The 4th commit aims to revert the fix in #123516 because I confirmed that the ICE solved by the PR doesn't happen if I modify report_error(). I think the root cause of that ICE is the same as #125323 . But I can discard this commit since we can fix #125323 without it.