-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Open
Labels
A-new-solverBugs from the new solver migration - should be fixed before stable releaseBugs from the new solver migration - should be fixed before stable releaseA-tytype system / type inference / traits / method resolutiontype system / type inference / traits / method resolutionC-bugCategory: bugCategory: bug
Description
This code causes a type mismatch:
trait Iterator {
type Item;
fn partition<F>(&self, f: F)
where
F: FnMut(&Self::Item) -> bool,
{
}
}
struct Iter;
impl Iterator for Iter {
type Item = i32;
}
fn main() {
Iter.partition(|n| true);
}
It shows expected {closure#641024}, found {closure#641024}
, which is quite confusing. The reason is they differ in their substitutions.
I know the cause and fixed it locally but it causes another bug, see #t-compiler/rust-analyzer > Chalk inference table @ 💬. Opening this issue just so we can track this.
CC #20548 - the bugs could be related.
merlinaudio
Metadata
Metadata
Assignees
Labels
A-new-solverBugs from the new solver migration - should be fixed before stable releaseBugs from the new solver migration - should be fixed before stable releaseA-tytype system / type inference / traits / method resolutiontype system / type inference / traits / method resolutionC-bugCategory: bugCategory: bug