Skip to content

normalizes-to bound in old solver is stronger than new solver #1

Closed
rust-lang/rust
#118725
@compiler-errors

Description

@compiler-errors
fn next<T: Iterator<Item = U>, U>(t: &mut T) -> Option<U> {
    t.next()
}

fn foo<T: Iterator>(t: &mut T) {
    let _: Option<T::Item> = next(t);
}

In foo, the bound T::Item normalizes-to T::Item holds in the old solver in order for us to infer U = T::Item in the call to next.


This issue has been fixed by splitting Projection and NormalizesTo goals. Projection goals get proven by simply equating the alias and the term while NormalizesTo actually requires normalization.

(originally compiler-errors/next-solver-hir-issues#1 (comment))

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions