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

Tracking Issue for impl for<'a> Trait<'a> #104288

Open
3 tasks
oli-obk opened this issue Nov 11, 2022 · 1 comment
Open
3 tasks

Tracking Issue for impl for<'a> Trait<'a> #104288

oli-obk opened this issue Nov 11, 2022 · 1 comment
Labels
C-bug Category: This is a bug. F-type_alias_impl_trait `#[feature(type_alias_impl_trait)]`

Comments

@oli-obk
Copy link
Contributor

oli-obk commented Nov 11, 2022

Some context can be found in this comment.

We would like to support using higher kinded lifetimes in opaque types.

At present

#![feature(type_alias_impl_trait)]

trait Tr<'a> {
    type Assoc;
}

impl<'a> Tr<'a> for () {
    type Assoc = ();
}

type Associated<'a> = impl Copy;
type Associated2<'a> = impl Copy + 'a;

fn f() -> impl for<'a> Tr<'a, Assoc = Associated2<'a>> {}
fn f1() -> impl for<'a> Tr<'a, Assoc = Associated<'a>> {}

impl<'a> Tr<'a> for i32 {
    type Assoc = &'a ();
}

fn f2() -> impl for<'a> Tr<'a, Assoc = Associated2<'a>> { 42_i32 }
fn f3() -> impl for<'a> Tr<'a, Assoc = Associated<'a>> { 42_i32 }

errors, though with a different error message than the equivalent code for RPIT.

An implementation should also add tests that actually use the higher kinded lifetimes, e.g. via closures or similar datastructures.

About tracking issues

Tracking issues are used to record the overall progress of implementation.
They are also used as hubs connecting to other relevant issues, e.g., bugs or open design questions.
A tracking issue is however not meant for large scale discussion, questions, or bug reports about a feature.
Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.

Steps

Unresolved Questions

Implementation history

@oli-obk oli-obk added the C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. label Nov 11, 2022
@SkiFire13
Copy link
Contributor

The issue title seems to be swapping the impl and for<'a>

@jackh726 jackh726 changed the title Tracking Issue for for<'a> impl Trait<'a> Tracking Issue for impl for<'a> Trait<'a> Nov 21, 2022
@compiler-errors compiler-errors added C-bug Category: This is a bug. and removed C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. labels Nov 30, 2022
@ChrisDenton ChrisDenton added the needs-triage-legacy Old issue that were never triaged. Remove this label once the issue has been sufficiently triaged. label Jul 16, 2023
@fmease fmease added F-type_alias_impl_trait `#[feature(type_alias_impl_trait)]` and removed needs-triage-legacy Old issue that were never triaged. Remove this label once the issue has been sufficiently triaged. labels Jan 25, 2024
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)]`
Projects
None yet
Development

No branches or pull requests

5 participants