Closed fpoli closed 3 months ago
It might be better to add something like -Z mir-opt-level=0
to all our test cases. I'm afraid that many useful tests might have been invalidated by the experimental MIR-level optimizations that are enabled by default in nighly compiler versions.
Silver has the same issue: https://github.com/viperproject/silver/issues/782
Given
a / b
, fora < 0
in Rust the result is still rounded toward 0, while in Viper it is rounded away from 0. Prusti currently encodes signed integer divisions using Viper's semantics, which is wrong.If someone wants to work on this, the fix can be done similarly to how
fn rem
is used to encode the correct semantics of signed modulo operations.