Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ICE when referencing associated const within struct itself. #26246

Closed
Mr-Byte opened this issue Jun 12, 2015 · 1 comment
Closed

ICE when referencing associated const within struct itself. #26246

Mr-Byte opened this issue Jun 12, 2015 · 1 comment
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@Mr-Byte
Copy link

Mr-Byte commented Jun 12, 2015

The following code on the current nightly produces an ICE:

#![feature(associated_consts)]

struct Test {
    _x: [u32; Test::ARRAY_SIZE]
}

impl Test {
    const ARRAY_SIZE: usize = 4;
}

fn main() {}

The compiler outputs the following:

error: internal compiler error: unexpected panic
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 'path not fully resolved: PathResolution { base_def: DefTy(DefId { krate: 0, node: 4 }, false), last_private: LastMod(AllPublic), depth: 1 }', /home/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/librustc/middle/def.rs:81
@arielb1 arielb1 added the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label Jun 12, 2015
@quantheory
Copy link
Contributor

Duplicate of #25145, I think. The recursion here is actually not necessary to trigger an error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

4 participants