Skip to content

Inference hazard due to lazy alias relate: Break it in the old solver? #168

@compiler-errors

Description

@compiler-errors

Lazy alias relate causes us to no longer (incompletely) infer alias args when we don't normalize aliases to infer vars. That causes this code to (rightfully, IMO) fail:

trait Foo {
    type Assoc<'a>;
}

fn foo<'a, T: Foo>(_: <T as Foo>::Assoc<'a>) {}

fn test<'a, T: Foo>() {
    let y: fn(<T as Foo>::Assoc<'a>) = foo;
}

I'd like to prevent this from being more of an issue, but nothing comes to mind for a good scheme to weaken this inference in the old solver. Ideas?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions