Skip to content

Ambiguous associated item error when deriving TryFrom, TryInto or FromStr #409

Closed
@bluurryy

Description

Deriving TryFrom, TryInto or FromStr when there's an associated item called Error or Err will fail.

All of these derives fail:

use derive_more::*;

#[derive(TryFrom)]
#[try_from(repr)]
#[repr(u8)]
enum LogLevel {
    Error,
}

#[derive(FromStr)]
enum EnumNoFields {
    Err,
}

#[derive(TryInto)]
enum MixedInts {
    Foo(LogLevel),
}

I will send a PR shortly that will fix this issue.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions