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

type inference breaks if there is more than one IntoIterator bound. #10653

Open
jhgg opened this issue Oct 28, 2021 · 2 comments
Open

type inference breaks if there is more than one IntoIterator bound. #10653

jhgg opened this issue Oct 28, 2021 · 2 comments
Labels
A-ty type system / type inference / traits / method resolution C-bug Category: bug S-unactionable Issue requires feedback, design decisions or is blocked on other work

Comments

@jhgg
Copy link
Contributor

jhgg commented Oct 28, 2021

With this code, the B: IntoIterator<Item = Foo>, bound added breaks inference on a.

struct Foo {
    bar: u64,
}

fn what<A, B>(a: A, b: B)
where
    A: IntoIterator<Item = Foo>,
    B: IntoIterator<Item = Foo>,
{
    a.into_iter().map(|x| x.bar).count();
}

image
image

rust-analyzer version: dd43f3f 2021-10-27 nightly

@lnicola lnicola added A-ty type system / type inference / traits / method resolution C-bug Category: bug S-actionable Someone could pick this issue up and work on it right now labels Oct 28, 2021
@flodiebold
Copy link
Member

Likely the same issue as #9990

@flodiebold
Copy link
Member

flodiebold commented Feb 15, 2024

rust-lang/chalk#750 is the Chalk root cause. #11242 has a reproduction in a hir-ty test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ty type system / type inference / traits / method resolution C-bug Category: bug S-unactionable Issue requires feedback, design decisions or is blocked on other work
Projects
None yet
Development

No branches or pull requests

4 participants