Closed
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>(
| ^^^^