Skip to content

Support unresolved type alias as well #141

@zgrannan

Description

@zgrannan

Don't add outlives constraints, even if assoc types have lifetime params:

Aureas examples (for reference):

trait Foo<'a> {
    type Assoc<'b> where 'a: 'b, Self: 'b;
    fn get<'b>(&'b mut self) -> Self::Assoc<'b>;
}

struct A<'a> {
    f: &'a mut i32,
}

impl<'a> Foo<'a> for A<'a> {
    type Assoc<'b> = &'b mut i32
         where 'a: 'b, Self: 'b;
    fn get<'b>(&'b mut self) -> Self::Assoc<'b> {
        &mut self.f
    }
}

fn main() {
    let mut i = 42;
    let mut a = A {
        f: &mut i,
    };
    *a.get() += 1;
    println!("{i}");
}

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