Skip to content

Associated consts cannot depend on type parameters or Self #26524

Closed
@yongqli

Description

@yongqli

This fails to compile

trait Matrix {
    const EYE: f64;
}

fn get_EYE<M: Matrix>(t: M) {
    M::EYE
}

with error: Associated consts cannot depend on type parameters or Self. [E0329], but it should work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-associated-itemsArea: Associated items (types, constants & functions)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions