creusot icon indicating copy to clipboard operation
creusot copied to clipboard

Mismatched types error in ghost macro

Open voidc opened this issue 2 years ago • 1 comments

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) };
}

voidc avatar Jun 29 '22 14:06 voidc

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).

xldenis avatar Jul 07 '22 23:07 xldenis