Skip to content

regression with the new opaque type generics #122307

Closed
@aliemjay

Description

@aliemjay

The following should compile.

#![feature(type_alias_impl_trait)]
#![allow(unconditional_recursion)]

type Opaque<'a> = impl Sized + 'a;

fn test<'a>() -> Opaque<'a> {
    let _: () = test::<'a>();
    //~^ ERROR expected generic lifetime parameter, found `'_`
}

Regressed in #122103. With the new generics of Opaque, the defining use at the let statement is Opaque<'_, 'a> := (). Cc @compiler-errors

Metadata

Metadata

Labels

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

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions