Skip to content

TAIT still captures lifetime generics implicitely #103642

Closed

Description

This code should pass but it doesn't:

#![feature(type_alias_impl_trait)]

trait Callable {
    type Output;
    fn call() -> Self::Output;
}

impl<'a> Callable for &'a () {
    type Output = impl Sized;
    fn call() -> Self::Output {}
}

fn test<'a>() -> impl Sized {
    <&'a () as Callable>::call()
    //~^ ERROR hidden type captures lifetime that does not appear in bounds
}

This is #96996 resurrected. Cc @oli-obk.

@rustbot label F-type_alias_impl_trait C-bug T-compiler T-types

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

C-bugCategory: This is a bug.F-type_alias_impl_trait`#[feature(type_alias_impl_trait)]`T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.T-typesRelevant to the types team, which will review and decide on the PR/issue.

Type

No type

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions