Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correctly infer lifetimes, & disambiguate result type in try-from. #41

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

mrenow
Copy link

@mrenow mrenow commented Oct 23, 2024

Thanks for the crate! New to rust and repo maintenance, but hoping that the following changes can be helpful.

Noticed that that the following example infers the lifetime of <'b> for Command, but doesnt pick up the lifetime of 'a

#[subenum(Command)]
pub enum Expression<'a, 'b> {
    #[subenum(Command)]
    CommandWithNoArgs(&'b SomeCommand<'a>) // 'a will not be registered, won't compile.
    ...
}

I have handled the respective case and written some tests.

I also noticed that a local definition of Result was clashing with the try-from signature, so I disambiguated the type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant