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

Multiple IntoIterator bounds break type inference #18381

Closed
indietyp opened this issue Oct 23, 2024 · 1 comment
Closed

Multiple IntoIterator bounds break type inference #18381

indietyp opened this issue Oct 23, 2024 · 1 comment
Labels
C-bug Category: bug

Comments

@indietyp
Copy link

When having multiple IntoIterator bounds on a function - even if completely unrelated - type inference breaks down.

rust-analyzer version: nightly-2024-10-21

rustc version: rustc 1.84.0-nightly (662180b34 2024-10-20)

editor or extension: Zed on mac

code snippet to reproduce:

fn x<A, B>(a: A)
where
    A: IntoIterator<Item = u8>,
    B: IntoIterator<Item = u16>,
{
    for u in a {}
}

Image

when we change B to any other bound, like: B: Iterator<Item = u16> the type inference will work for a:

fn x<A, B>(a: A)
where
    A: IntoIterator<Item = u8>,
    B: Iterator<Item = u16>,
{
    for u in a {}
}

Image

@indietyp indietyp added the C-bug Category: bug label Oct 23, 2024
@lnicola
Copy link
Member

lnicola commented Oct 23, 2024

Duplicate of #10653.

@lnicola lnicola closed this as completed Oct 23, 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

2 participants