Skip to content

associated type_consts can have defaults without the associated_type_defaults feature gate #130288

@BoxyUwU

Description

@BoxyUwU

The following is valid rust code:

#![feature(min_generic_const_args)

trait Trait {
    #[type_const]`
    const ASSOC: usize = 10;
}

We don't allow this for types, e.g. type Assoc = u32;. I expect associated type consts to have equivalent problems to associated type defaults given they are functionally equivalent in the type system. We should feature gate this under associated_type_defaults

Metadata

Metadata

Assignees

Labels

A-const-genericsArea: const generics (parameters and arguments)C-bugCategory: This is a bug.F-min_generic_const_args`#![feature(min_generic_const_args)]`T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions