-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Does not infer associated type in another associated type #2603
Comments
I think this is a slightly different issue than the one in #2592. This one I think is probably related to rust-lang/chalk#234; the one in #2592 is more complicated, because Chalk would need to know that integer variables can only be one of a few different types for that one. |
Another case possibly related to that Chalk issue: trait T {
type O;
}
impl T for () {
type O = ();
}
fn f<X, F>(_v: F)
where
X: T,
F: FnOnce(X::O),
{
}
fn main() {
f::<(), _>(|_z| {});
} |
Another simple case: let mut action_contexts: Vec<i32> = vec![1, 2, 3];
for v in action_contexts.iter_mut() {
dbg!(v);
} |
Example from #3548: let x = vec![Foo {i: 1}, Foo {i: 2}];
if let Some(found) = x.iter().find(|x| x.i == 1) {
found.<CURSOR_HERE>
} |
All these examples work now 🎉 |
So do iterator work now ? Yeah |
It is related to #2592:
The text was updated successfully, but these errors were encountered: