Skip to content

unconstrained assoc type of opaque type inference regression #248

@lcnr

Description

@lcnr
fn foo() -> impl IntoIterator<Item = u32> {
    if false {
        let x: Vec<_> = foo().into_iter().collect();
    }
    
    [1, 2]
}
error[E0282]: type annotations needed
 --> <source>:3:25
  |
3 |         let x: Vec<_> = foo().into_iter().collect();
  |                         ^^^^^^^^^^^^^^^^^ cannot infer type

While we're able to do method selection on foo() itself, we can't do so on <opaque_infer as IntoIterator>::IntoIter as that one is treated as an ordinary inference variable.

Affects loess-0.2.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    from-craterA regression found via a crater run, not part of our test suite

    Type

    No type

    Projects

    Status

    todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions