Skip to content
This repository was archived by the owner on Jan 11, 2026. It is now read-only.
This repository was archived by the owner on Jan 11, 2026. It is now read-only.

Feature request: "Missing initial state" error when using Self #32

@mx00s

Description

@mx00s

When I had this trait for transitions relating to my Opened state everything worked as expected with the new function making Opened the start state.

pub trait Opened {
    fn new() -> Opened;
    // ...
}

However, changing the return value for new from Opened to Self causes the macro to abort with several errors, beginning with:

error: Missing initial state. To declare an initial state you can use a function with signature like fn f() -> T where T is a declared state.

It would be nicer, I think, if I could use -> Self because it helps make the initial state stand out.

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