Skip to content

internal compiler error: no def for path when using associated consts #27078

Closed
@retep998

Description

@retep998
#![feature(associated_consts)]
trait Foo { const BAR: i32; fn foo(self) -> &'static i32 { &<Self>::BAR }}
fn main() {}
<anon>:3:61: 3:72 error: internal compiler error: no def for path 17
<anon>:3 trait Foo { const BAR: i32; fn foo(self) -> &'static i32 { &<Self>::BAR }}
                                                                     ^~~~~~~~~~~
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
note: run with `RUST_BACKTRACE=1` for a backtrace
thread 'rustc' panicked at 'Box<Any>', ../src/libsyntax/diagnostic.rs:176

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-associated-itemsArea: Associated items (types, constants & functions)A-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)C-bugCategory: This is a bug.E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions