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

About two IntoIterator Generic param type error #16354

Closed
A4-Tacks opened this issue Jan 12, 2024 · 3 comments
Closed

About two IntoIterator Generic param type error #16354

A4-Tacks opened this issue Jan 12, 2024 · 3 comments
Labels
C-bug Category: bug

Comments

@A4-Tacks
Copy link

pub fn assert_equal<T: PartialEq<U> + std::fmt::Debug, U: std::fmt::Debug>(
    a: impl IntoIterator<Item = T>,
    b: impl IntoIterator<Item = U>,
) {
    let (a, b) = (a.into_iter(), b.into_iter());
    let a_size: usize = a.size_hint().0;
    let b_size: usize = b.size_hint().0;
    let mut elems = Vec::with_capacity(usize::min(a_size, b_size));
    for (a, b) in a.zip(b) {
        assert_eq!(a, b, "left != right, elems: {:?}", elems);
        elems.push(a);
    }
}

cargo check: 0 errors, 0 warnings
elems: Vec<{unknown}>
open doc from usize::min, output: core::iter::traits::iterator::Iterator::min

rust-analyzer version: rust-analyzer 1.77.0-nightly (bf8716f1 2023-12-24)

rustc version: rustc 1.77.0-nightly (bf8716f1c 2023-12-24)

relevant settings: NONE

@A4-Tacks A4-Tacks added the C-bug Category: bug label Jan 12, 2024
@Austaras
Copy link
Contributor

Possibly duplicate of #15027

@A4-Tacks
Copy link
Author

Possibly duplicate of #10653

@flodiebold
Copy link
Member

It's a duplicate of #10653, yes (there might also be even older reports of this...)

@flodiebold flodiebold closed this as not planned Won't fix, can't repro, duplicate, stale Feb 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug
Projects
None yet
Development

No branches or pull requests

3 participants