Skip to content

Unsound associated type outlives bound due to lazy norm #59

Open
@compiler-errors

Description

@compiler-errors
trait StaticTy {
    type Item<'a>: 'static;
}

impl StaticTy for () {
    type Item<'a> = &'a ();
    //~^ ERROR  the type `&'a ()` does not fulfill the required lifetime
}

fn main() {}

This code passes with -Ztrait-solver=next in check_type_bounds since we don't normalize the types that show up in type-outlives bounds, so we end up seeing a ty::Alias during process_registered_region_obligations and end up using the item bounds :/

We might need to pass a normalization fn down to process_registered_region_obligations like we do for trait_ref_is_knowable?

Metadata

Metadata

Assignees

No one assigned

    Labels

    not-blocking-coherenceAn issue we can resolve after stabilizing the new solver during coherence

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions