-
Notifications
You must be signed in to change notification settings - Fork 129
Add an option to skip codegen #4002
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
Conversation
|
If I run // Error: not a boolean expression
#[kani::requires(x - 2)]
fn main(x: u32) {
let x: i32 = 5;
// Error: different types
let y: u32 = x;
assert_eq!(y, 5);
}I get these error messages: So my question is: how is this option better than just running Kani and seeing what happens? These type errors will cause Kani to abort before codegen already. |
|
Right, but the point is the behavior in the case where there are no errors. This option makes it terminate immediately without going through codegen (similar to |
carolynzech
left a comment
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.
Two documentation nits, take them or leave them. The changes in phrasing are meant to make clearer that this is more useful than the default in the success case.
Co-authored-by: Carolyn Zech <[email protected]>
This PR adds a new unstable option, `--no-codegen`, that can be used for running Kani, just to check if the code compiles, i.e. similar to running `cargo check`. This is useful as a lightweight check for compilation errors including code under `#[cfg(kani)]`. This is implemented through passing rustc's `-Zno-codegen` option, which is what `cargo check` passes to `rustc`. By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses. --------- Co-authored-by: Carolyn Zech <[email protected]>
This PR adds a new unstable option,
--no-codegen, that can be used for running Kani, just to check if the code compiles, i.e. similar to runningcargo check. This is useful as a lightweight check for compilation errors including code under#[cfg(kani)].This is implemented through passing rustc's
-Zno-codegenoption, which is whatcargo checkpasses torustc.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.