Skip to content

Commit

Permalink
Fix issue with ambiguous associated items
Browse files Browse the repository at this point in the history
  • Loading branch information
Juici committed Mar 18, 2024
1 parent 96536bb commit 8a01b78
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/expand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ fn derive_enum(input: EnumInput) -> Result<TokenStream> {
type Error = #repr;

#[inline]
fn try_from(v: #repr) -> ::core::result::Result<Self, Self::Error> {
fn try_from(v: #repr) -> ::core::result::Result<Self, #repr> {
match v {
#(#try_from_int_args)*
v => ::core::result::Result::Err(v),
Expand Down
10 changes: 10 additions & 0 deletions tests/issues.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
use int_enum::IntEnum;

#[test]
fn issue17() {
#[derive(Debug, PartialEq, IntEnum)]
#[repr(u8)]
enum Issue17 {
Error = 0,
}
}

0 comments on commit 8a01b78

Please sign in to comment.