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

ensure that '_ and GATs yields errors #95305

Closed
nikomatsakis opened this issue Mar 25, 2022 · 1 comment · Fixed by #95312
Closed

ensure that '_ and GATs yields errors #95305

nikomatsakis opened this issue Mar 25, 2022 · 1 comment · Fixed by #95312
Labels
A-GATs Area: Generic associated types (GATs) F-generic_associated_types `#![feature(generic_associated_types)]` a.k.a. GATs GATs-blocking Issues using the `generic_associated_types` feature that block stabilization GATs-triaged Issues using the `generic_associated_types` feature that have been triaged

Comments

@nikomatsakis
Copy link
Contributor

It's not clear how '_ and GATs should interact. We should add tests that using '_ either in the parameter list of a GAT or in its value is prohibited.

e.g., both of these should error (and currently do)

#![feature(generic_associated_types)]

trait Foo {
    type Item<'a>;
}

fn foo(x: &impl Foo<Item<'_> = u32>) { }
#![feature(generic_associated_types)]

trait Foo {
    type Item<'a>;
}

fn foo(x: &impl for<'a> Foo<Item<'a> = &'_ u32>) { }
@nikomatsakis nikomatsakis added F-generic_associated_types `#![feature(generic_associated_types)]` a.k.a. GATs GATs-blocking Issues using the `generic_associated_types` feature that block stabilization labels Mar 25, 2022
@marmeladema
Copy link
Contributor

@bors claim

@nikomatsakis nikomatsakis added the GATs-triaged Issues using the `generic_associated_types` feature that have been triaged label Apr 13, 2022
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this issue Apr 28, 2022
…r=jackh726

Ensure that `'_` and GAT yields errors

Fixes rust-lang#95305

`@bors` r? `@jackh726`
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this issue Apr 28, 2022
…r=jackh726

Ensure that `'_` and GAT yields errors

Fixes rust-lang#95305

``@bors`` r? ``@jackh726``
@bors bors closed this as completed in d665a5e Apr 28, 2022
@fmease fmease added the A-GATs Area: Generic associated types (GATs) label Nov 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-GATs Area: Generic associated types (GATs) F-generic_associated_types `#![feature(generic_associated_types)]` a.k.a. GATs GATs-blocking Issues using the `generic_associated_types` feature that block stabilization GATs-triaged Issues using the `generic_associated_types` feature that have been triaged
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants