-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
C-bugCategory: This is a bug.Category: This is a bug.F-type_alias_impl_trait`#[feature(type_alias_impl_trait)]``#[feature(type_alias_impl_trait)]`T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
I expect this to compile:
#![feature(type_alias_impl_trait)]
type Opaque<'lt> = impl Sized + 'lt;
fn test<'a>(
arg: impl Iterator<Item = &'a u8>,
) -> impl Iterator<Item = Opaque<'a>> {
arg
}
Instead, it is an error in 1.73.0-nightly (2023-08-16 07438b0):
error: non-defining opaque type use in defining scope
--> src/lib.rs:5:6
|
5 | ) -> impl Iterator<Item = Opaque<'a>> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ generic argument `'a` used twice
|
note: for this opaque type
--> src/lib.rs:5:6
|
5 | ) -> impl Iterator<Item = Opaque<'a>> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: item constrains opaque type that is not in its signature
--> src/lib.rs:5:6
|
5 | ) -> impl Iterator<Item = Opaque<'a>> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: this item must mention the opaque type in its signature in order to be able to register hidden types
note: this item must mention the opaque type in its signature in order to be able to register hidden types
--> src/lib.rs:3:4
|
3 | fn test<'a>(
| ^^^^
mpfaff
Metadata
Metadata
Assignees
Labels
C-bugCategory: This is a bug.Category: This is a bug.F-type_alias_impl_trait`#[feature(type_alias_impl_trait)]``#[feature(type_alias_impl_trait)]`T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.