Skip to content

#[verus_spec] macro errors within impl blocks. #1916

@hiroki-chen

Description

@hiroki-chen

Description

The following code does not compile

pub struct Foo;

impl Foo {
    #[verus_spec(ret =>
        with
            Tracked(c): Tracked<&mut DekoPointsTo<()>>
        requires
            true,
        ensures
            ret == 1,
    )]
    fn test(a: u64, b: u64) -> u64 {
        1
    }
}

Moving the function body outside Foo makes Rust compiler happy, however. This should have something to do with the proc_macro bug. Also a sidenote, adding a trailing comma after arguments in with block causes macro expansion error.

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