Skip to content

Fully qualified path to nested consts complains about ambiguous associated type #53810

@estebank

Description

@estebank

I believe the following code should be accepted by the compiler, but currently complains with error[E0223]: ambiguous associated type:

struct C;

impl C {
    const X: usize = 42;
}

struct S;

impl S {
    const foo: C = C;
}

fn main() {
    let _ = S::foo::X;
}

Might be needed before #26760 (comment) can be done.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-associated-itemsArea: Associated items (types, constants & functions)A-trait-systemArea: Trait systemA-type-systemArea: Type systemC-bugCategory: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.T-typesRelevant to the types 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