Skip to content

ghost uses of never type invalidates borrowchecking #2219

@tjhance

Description

@tjhance

Verus wrongly accepts this:

proof fn test(nvr: !) { }
proof fn consume<T>(tracked t: T) { }

proof fn test2<T>(tracked t: T) {
    test(arbitrary());

    consume(t);
    consume(t);
}

because the ghost use of the ! type causes Rust to think the consume statements are unreachable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions