You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Kani assert override is more restrictive than standard assert #2108
changed the title [-]Kani asser override is more restrictive than standard assert[/-][+]Kani assert override is more restrictive than standard assert[/+]on Jan 12, 2023
which is what the standard assert macro expands to, but it is not valid without the negation:
fn main(){let v:bool = true;if&v {}
$ rustc not_neg.rs
error[E0308]: mismatched types
--> not_neg.rs:3:8
|
3 |if&v { }
| ^^ expected `bool`, found `&bool`|
help: consider removing the borrow
|
3 - if&v { }
3 + if v { }
|
error: aborting due to previous error
For more information about this error, try `rustc --explain E0308`.
Activity
[-]Kani asser override is more restrictive than standard assert[/-][+]Kani assert override is more restrictive than standard assert[/+]zhassan-aws commentedon Jan 12, 2023
Interesting. Apparently, this is valid Rust:
which is what the standard
assertmacro expands to, but it is not valid without the negation:zhassan-aws commentedon Jan 12, 2023
I've opened #2117 to fix this via a hack. Out of curiosity, where did you see this? It is a bit confusing that
if !&bis valid Rust butif &bisn't.Fix assert! and cover! expansions in expression contexts (model-check…