Skip to content

#[verus_spec] errors when trailing comma is added in with clause. #1936

@hiroki-chen

Description

@hiroki-chen

The following code does not parse:

#[verus_spec(res =>
    with
        Tracked(bar): Tracked<&mut ()>,
    requires
        true,
    ensures
        true,
)]
fn foo() {}

This generates

error: expected `:`
   |
11 |         true,
   |         ^^^^

I mentioned this in #1916 but think another separate issue might be clearer for tracking. It'd be more ergonomic to allow trailing commas though (e.g. for code refactoring, proof-reading.).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions