Skip to content

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

Closed

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

Activity

  1. added
    T-compiler
    A-const-generics
    F-gca_min_const_items
    on Sep 12, 2024
  2. added
    needs-triage
    on Sep 12, 2024
  3. removed
    needs-triage
    on Sep 12, 2024
  4. added
    C-bug
    on Feb 14, 2025
  5. changed the title [-]Trait associated constants can have defaults while types cant[/-] [+]associated type_consts can have defaults without the `associated_type_defaults` feature gate[/+] on Feb 3, 2026
  6. LaneAsade commented on Feb 7, 2026

    @LaneAsade
    Member

    @rustbot claim

  7. added 3 commits that reference this issue on Feb 22, 2026
  8. added a commit that references this issue on Feb 22, 2026
  9. fmease commented on Apr 6, 2026

    @fmease
    Member

    This was fixed in PR #152385.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

A-const-genericsC-bugF-gca_min_const_itemsT-compiler

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions