Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TAIT still captures lifetime generics implicitely #103642

Closed
aliemjay opened this issue Oct 27, 2022 · 1 comment · Fixed by #103876
Closed

TAIT still captures lifetime generics implicitely #103642

aliemjay opened this issue Oct 27, 2022 · 1 comment · Fixed by #103876
Assignees
Labels
C-bug Category: This is a bug. F-type_alias_impl_trait `#[feature(type_alias_impl_trait)]` T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-types Relevant to the types team, which will review and decide on the PR/issue.

Comments

@aliemjay
Copy link
Member

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

@rustbot rustbot added C-bug Category: This is a bug. F-type_alias_impl_trait `#[feature(type_alias_impl_trait)]` T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-types Relevant to the types team, which will review and decide on the PR/issue. labels Oct 27, 2022
@oli-obk
Copy link
Contributor

oli-obk commented Oct 27, 2022

Oh heh, I fixed the situation for registering the hidden type but didn't allow implying anything from that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. F-type_alias_impl_trait `#[feature(type_alias_impl_trait)]` T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-types Relevant to the types team, which will review and decide on the PR/issue.
3 participants