Skip to content

Conversation

@Dzejkop
Copy link
Contributor

@Dzejkop Dzejkop commented Apr 9, 2025

Hey! First of all great crate and lovely code - it's been a breeze figuring this out.

Currently the following code:

#[auto_impl(Arc, Box, Rc, &, &mut)]
trait HasAssociatedTypeWithBoundsAndWhereClause {
    type AssociatedType<'a, T>
    where
        T: From<usize> + 'a;
}

fails to compile because the macro doesn't generate the correct trait bounds and/or where clause on the associated type.

This PR fixes it by splitting the generics of an TraitItemType with Generics::split_for_impl - doesn't affect any other cases.

Copy link
Member

@KodrAus KodrAus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Dzejkop! This looks good to me

@KodrAus KodrAus merged commit 87f2009 into auto-impl-rs:main Apr 9, 2025
4 checks passed
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.

2 participants