creusot
creusot copied to clipboard
Mismatched types error in ghost macro
The following code produces a mismatched types error:
fn foo() {
let mut c: Ghost<usize> = ghost! { 0 };
c = ghost! { *c + 1 };
// expected reference, found `usize`
}
However, when surrounding the expressing with parentheses, the code compiles:
fn foo() {
let mut c: Ghost<usize> = ghost! { 0 };
c = ghost! { (*c + 1) };
}
Another issue I've found: the ghost!
macro does not work well when storing ghost values in types, it doesn't compile properly when compiling in passthrough mode (not creusot).