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

IntoIterator deriving fails on typed struct #151

Closed
hrls opened this issue Dec 30, 2020 · 1 comment · Fixed by #284
Closed

IntoIterator deriving fails on typed struct #151

hrls opened this issue Dec 30, 2020 · 1 comment · Fixed by #284
Labels
Milestone

Comments

@hrls
Copy link

hrls commented Dec 30, 2020

derive_more = "0.99.11"

use derive_more::IntoIterator;

#[derive(IntoIterator)]
struct Numbers<T> {
    #[into_iterator]
    numbers: Vec<i32>,
    _useless: std::marker::PhantomData<T>,
}

fn main() {
    let nums = Numbers::<()> {
        numbers: vec![100, 200],
        _useless: std::marker::PhantomData,
    };
    assert_eq!(Some(100), nums.into_iter().next());
}

Screenshot 2020-12-30 at 16 24 01

@tyranron tyranron added this to the 1.0.0 milestone Aug 11, 2023
@tyranron tyranron added the bug label Aug 11, 2023
@tyranron tyranron linked a pull request Aug 11, 2023 that will close this issue
3 tasks
@tyranron
Copy link
Collaborator

This was definitely fixed somewhere, and #284 introduced a test case covering it.

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 a pull request may close this issue.

2 participants