Skip to content

Default Associated Consts cannot use Self:: #32241

@strega-nil

Description

@strega-nil
#![feature(associated_consts)]

trait Boop {
    const X: fn() = Self::x;
    fn x();
}

errors with

<anon>:4:21: 4:28 error: failed to resolve. Use of undeclared type or module `Self` [E0433]
<anon>:4     const X: fn() = Self::x;
                             ^~~~~~~
<anon>:4:21: 4:28 help: see the detailed explanation for E0433
<anon>:4:21: 4:28 error: unresolved name `Self::x` [E0425]
<anon>:4     const X: fn() = Self::x;
                             ^~~~~~~
<anon>:4:21: 4:28 help: see the detailed explanation for E0425

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-resolveArea: Name/path resolution done by `rustc_resolve` specifically

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions