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

Consider associated types of type parameters for implied bounds #399

Merged
merged 7 commits into from
Aug 20, 2024

Conversation

tyranron
Copy link
Collaborator

@tyranron tyranron commented Aug 19, 2024

Related to #387

Synopsis

After #387, the following snippet fails to compile:

#[derive(Debug)]
struct AssocType<I: Iterator> {
    iter: I,
    elem: Option<I::Item>,
}

This happens, because the implied bound Option<I::Item>: Debug is not generated.

Solution

Correct the ContainsGenericsExt::contains_generics() implementations to consider associated types of the type parameter.

Checklist

  • Documentation is updated (not required)
  • Tests are added/updated
  • CHANGELOG entry is added

@tyranron tyranron added the bug label Aug 19, 2024
@tyranron tyranron added this to the 1.0.1 milestone Aug 19, 2024
@tyranron tyranron self-assigned this Aug 19, 2024
@tyranron tyranron merged commit d7c4a68 into master Aug 20, 2024
17 checks passed
@tyranron tyranron deleted the consider-assoc-types-for-implied-bounds branch August 20, 2024 11:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants