Skip to content

unnormalized projections in writeback may contain infer vars #12

@lcnr

Description

@lcnr

If we have some <T as Id<?x>>::Assoc in hir typeck and the current impl normalizes that to T before writeback but is unable to infer ?x, then lazy norm would result in an inference error.

It seems like the following currently errors on stable, figure out why

trait Id<T: ?Sized> {
    type Assoc;
}

impl<T, U: ?Sized> Id<U> for T {
    type Assoc = T;
}

fn foo<T: Default>() -> T {
    <T as Id<_>>::Assoc::default()
}

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions