-
Notifications
You must be signed in to change notification settings - Fork 96
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
Throw a graceful error when type checking for ctpop
fails
#2504
Conversation
Thank you for your comments @celinval. I opened this PR so we have the diff available. At the moment I added this logic analogous with the example you posted. I can keep doing that for the other subissues, but my concern is that this both has a chance to miss other cases in which such type checks are necessary and also means that all checks are performed twice (in code gen and binding library) which means they can start to diverge at some point. Wrt types, I can make sure to use Thanks for clarifying on the abort. I'm not quite sure where the nearest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! That's about it. Can you also please add a test?
I can do that. What I feel like I haven't quite gotten an answer to yet is what I am supposed to do with the similar issues. #2121 contains a few concrete examples, but presumably this whole thing is bigger, as in there are many intrinsics that have type requirements that are checked via assert in |
3285620
to
70699f4
Compare
tests/expected/intrinsics/sub_with_workflow_ice_fixme/arithmetic_zst_fixme.rs
Outdated
Show resolved
Hide resolved
I force pushed an update with the requested changes to this branch but for some reason I don't see it reflected here. I'll have to investigate that. Sorry for the confusion |
a2c8c51
to
f924cee
Compare
Okay now it's reflected. |
Throws a graceful type error for `ctpop` in the code gen. Adds the expectation to the test case. Marks the test case as no longer `fixme`
Looks like only a few |
BTW, can you please update the title of this PR and description to something more meaningful? Thanks! |
ctpop
fails
I'm not sure what the perf regression error is supposed to tell me there. Can anyone shed a light? |
That actually looks like it's broken in CI. Don't worry about it, this check isn't blocking the PR. |
Description of changes:
This PR addresses one of the issue raised in #2121 where a typecheck for
ctpop
in the backend makes kani crash.With these changes it now reports a clean compiler error with the usual span information, e.g.
Resolved issues:
Relates to #2121
Concrete coverage of the subissues
ctpop
(ignored because failure happens in rustc, several similar issues are reported there and it seems there is no consensus whether a compiler panic on intrinsics should be considered appropriate ICE: broken mir: wrapping_mul() with copy bound rust-lang/rust#101962, ice: broken mir: end of phase transition to Optimization compiler/rustc_const_eval/src/transform/validate.rs:119:36 rust-lang/rust#92495)sub_with_overflow
(not reproducible for me, requires_mm
familyx86
)Call-outs / outstanding questions
Testing:
TODO
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.