Skip to content

non-defining use in defining scope: region params #74

Open
@lcnr

Description

@lcnr
#![feature(type_alias_impl_trait)]

type Tait<'a> = impl Sized;

fn define<'a>(x: &'a ()) -> Tait<'a> {
    ()
}

fn x<'a>(x: &'a (), t: Tait<'a>) -> Tait<'a> {
    t
}

This example fails with overflow in the new solver right now

error[E0275]: overflow evaluating the requirement `Tait<'a> <: Tait<'a>`
  --> src/main.rs:9:46
   |
9  |   fn x<'a>(x: &'a (), t: Tait<'a>) -> Tait<'a> {
   |  ______________________________________________^
10 | |     t
11 | | }
   | |_^

Changing alias relate or the way we define opaque types can cause this to result in ambiguity instead. Fundamentally we want exists<'0, '1> alias-relate(Tait<'0>, Tait<'1>) to hold inside of the defining scope of Tait, regardless of whether we actually define Tait.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions