Skip to content

we eagerly normalize Type-outlives bounds #63

@compiler-errors

Description

@compiler-errors

With rust-lang/rust#119101 and rust-lang/rust#120513 TypeOutlives obligations and assumptions are now eagerly normalized at the start of regionck and borrowck.

previous issue

Type-outlives bounds can be proven several ways -- via item bounds, via param-env clauses, and by recursively applying to the type's components. When applying param-env clauses that may satisfy a type-outlives bounds, we use the Match relation, which only considers types structurally.

That causes this code to go from passing to failing in the new trait solver:

trait Mirror {
    type Assoc;
}
impl<T> Mirror for T {
    type Assoc = T;
}

fn is_static<T: 'static>() {}

fn test<T>() where <T as Mirror>::Assoc: 'static {
    is_static::<T>();
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions