Skip to content

Incorrect verification results for function/closure dyn traits #240

@avanhatt

Description

@avanhatt

The following fails to verify:

fn foo(fun: &mut dyn FnMut(i32) -> i32) -> i32 {
    fun(1)
}

fn main() {
    let r = foo(&mut move |z : i32| { z } );
    assert!(r == 1); // should succeed
}

In the generated CBMC-C code, in some places we pass the closure argument as a tuple, but in others we expect the flattened int.

Metadata

Metadata

Assignees

Labels

[C] BugThis is a bug. Something isn't working.[F] SoundnessKani failed to detect an issue

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions