-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
skip rpit constraint checker if borrowck return type error #117884
Conversation
I'm still not sure why the ICE in #117794 happens, and this seems like a strange way to be avoiding an ICE in mir-building... Can you explain more specifically why the root cause occurs, and how this avoids it? |
I think the root cause of the issue can be traced back to the modifications made in
Therefore, in this PR, I've implemented a condition to bypass the checker when Another potential solution to this issue could involve altering the handling for |
I have made a minor modification: if a type error is found, then the borrow check is skipped during the |
I'm still not certain this is the right way to fix this bug. I would be much more satisfied if we understood what is wrong with mir building that leads to this issue -- this seems to be fixing a symptom of the problem, rather than the actual problem itself, in my opinion. |
Thanks for this tip, and I'll delve deeper |
I have recently investigated this issue:
However, I'm still not certain about the best solution and might need to investigate further. |
Hi @bvanjoi: I investigated this more. I think this is the correct approach, but with a minor tweak. Please add the check for
And you can remove the other checks for Sorry for the back and forth -- this was a very difficult issue. |
This also should fix #119025. |
@bors r+ |
☀️ Test successful - checks-actions |
Finished benchmarking commit (d14e52b): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)This benchmark run did not return any relevant results for this metric. CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 672.166s -> 672.948s (0.12%) |
Fixes #117794
Fixes #117886
Fixes #119025
Prior to change #117418, the value of
concrete_opaque_types
for mir_borrock(T::a::opaque)
was None
. However, due to modifications inbody.local_decls
, the return value had been changed.The changed of
body.local_decls
has let to the addition ofty:Error
to infcx.opaque_type_storage.opaque_types
during TypeChecker::equate_inputs_and_outputs
. This is due to it utilizing the output of a function signature that was appended during construct_error
(which previously only appended aty::Error
) and then executeTypeChecker::Related_types
.Therefore, in this PR, I've implemented a condition to bypass the rpit check when an error is encountered.
r? @compiler-errors