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

Unit-like structs in const generic arguments #67075

Open
sanxiyn opened this issue Dec 6, 2019 · 4 comments
Open

Unit-like structs in const generic arguments #67075

sanxiyn opened this issue Dec 6, 2019 · 4 comments
Labels
A-const-generics Area: const generics (parameters and arguments) C-bug Category: This is a bug. C-feature-request Category: A feature request, i.e: not implemented / a PR. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@sanxiyn
Copy link
Member

sanxiyn commented Dec 6, 2019

#![feature(const_generics)]

#[derive(PartialEq, Eq)]
struct Unit;
trait Const<const U: Unit> {}
impl Const<Unit> for () {} // wrong number of const arguments

Const<{Unit}> works. See also #66615.

@sanxiyn sanxiyn added A-const-generics Area: const generics (parameters and arguments) F-const_generics `#![feature(const_generics)]` labels Dec 6, 2019
@Centril Centril added C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Dec 6, 2019
@lcnr
Copy link
Contributor

lcnr commented Mar 26, 2020

@rustbot claim

@lcnr
Copy link
Contributor

lcnr commented Mar 29, 2020

@rustbot release-assignment

@rustbot rustbot removed their assignment Mar 29, 2020
@varkor
Copy link
Member

varkor commented Sep 13, 2020

This isn't an issue for min_const_generics, because user-defined types may not be used as const generic types.

@BoxyUwU
Copy link
Member

BoxyUwU commented Jul 2, 2024

I consider this to be a feature request for rust-lang/project-const-generics#42 and not an issue with adt_const_params so I am going to remove the label 👍

@BoxyUwU BoxyUwU added C-feature-request Category: A feature request, i.e: not implemented / a PR. and removed F-adt_const_params `#![feature(adt_const_params)]` labels Jul 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-const-generics Area: const generics (parameters and arguments) C-bug Category: This is a bug. C-feature-request Category: A feature request, i.e: not implemented / a PR. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

6 participants