<p dir="auto">The following code on the current nightly produces an ICE:</p>
<div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="#![feature(associated_consts)]

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

impl Test {
    const ARRAY_SIZE: usize = 4;
}

fn main() {}"><pre class="notranslate"><span class="pl-c1">#!<span class="pl-kos">[</span>feature<span class="pl-kos">(</span>associated_consts<span class="pl-kos">)</span><span class="pl-kos">]</span></span>

<span class="pl-k">struct</span> <span class="pl-smi">Test</span> <span class="pl-kos">{</span>
    <span class="pl-c1">_x</span><span class="pl-kos">:</span> <span class="pl-kos">[</span><span class="pl-smi">u32</span><span class="pl-kos">;</span> <span class="pl-smi">Test</span><span class="pl-kos">::</span><span class="pl-v">ARRAY_SIZE</span><span class="pl-kos">]</span>
<span class="pl-kos">}</span>

<span class="pl-k">impl</span> <span class="pl-smi">Test</span> <span class="pl-kos">{</span>
    <span class="pl-k">const</span> <span class="pl-v">ARRAY_SIZE</span><span class="pl-kos">:</span> <span class="pl-smi">usize</span> = <span class="pl-c1">4</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>

<span class="pl-k">fn</span> <span class="pl-en">main</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span><span class="pl-kos">}</span></pre></div>
<p dir="auto">The compiler outputs the following:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="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"><pre class="notranslate"><code class="notranslate">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
</code></pre></div>
<p dir="auto">I tried this code:</p>
<div class="highlight highlight-source-rust notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="#![feature(associated_consts)]

struct S;

impl S {
    const N: usize = 3;
}

static STUFF: [u8; S::N] = [0; S::N];

// NOTE: This works OK:
// static STUFF: [u8; 3] = [0; S::N];

fn main() {
    // NOTE: This works OK:
    // let stuff: [u8; S::N] = [0; S::N];
}"><pre class="notranslate"><span class="pl-c1">#!<span class="pl-kos">[</span>feature<span class="pl-kos">(</span>associated_consts<span class="pl-kos">)</span><span class="pl-kos">]</span></span>

<span class="pl-k">struct</span> <span class="pl-smi">S</span><span class="pl-kos">;</span>

<span class="pl-k">impl</span> <span class="pl-smi">S</span> <span class="pl-kos">{</span>
    <span class="pl-k">const</span> <span class="pl-v">N</span><span class="pl-kos">:</span> <span class="pl-smi">usize</span> = <span class="pl-c1">3</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>

<span class="pl-k">static</span> <span class="pl-v">STUFF</span><span class="pl-kos">:</span> <span class="pl-kos">[</span><span class="pl-smi">u8</span><span class="pl-kos">;</span> <span class="pl-smi">S</span><span class="pl-kos">::</span><span class="pl-v">N</span><span class="pl-kos">]</span> = <span class="pl-kos">[</span><span class="pl-c1">0</span><span class="pl-kos">;</span> <span class="pl-smi">S</span><span class="pl-kos">::</span><span class="pl-v">N</span><span class="pl-kos">]</span><span class="pl-kos">;</span>

<span class="pl-c">// NOTE: This works OK:</span>
<span class="pl-c">// static STUFF: [u8; 3] = [0; S::N];</span>

<span class="pl-k">fn</span> <span class="pl-en">main</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
    <span class="pl-c">// NOTE: This works OK:</span>
    <span class="pl-c">// let stuff: [u8; S::N] = [0; S::N];</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">I get the error:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="thread 'rustc' panicked at 'path not fully resolved: PathResolution { base_def: DefTy(DefId { krate: 0, node: 4 }, false), last_private: LastMod(AllPublic), depth: 1 }', /Users/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-mac/build/src/librustc/middle/def.rs:81"><pre class="notranslate"><code class="notranslate">thread 'rustc' panicked at 'path not fully resolved: PathResolution { base_def: DefTy(DefId { krate: 0, node: 4 }, false), last_private: LastMod(AllPublic), depth: 1 }', /Users/rustbuild/src/rust-buildbot/slave/nightly-dist-rustc-mac/build/src/librustc/middle/def.rs:81
</code></pre></div>
<h2 dir="auto">Meta</h2>
<p dir="auto"><code class="notranslate">rustc --version --verbose</code>:<br>
rustc 1.1.0-nightly (<a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/rust-lang/rust/commit/7bd71637ca40910dbd310813a19abf76db84f8f6/hovercard" href="https://github.com/rust-lang/rust/commit/7bd71637ca40910dbd310813a19abf76db84f8f6"><tt>7bd7163</tt></a> 2015-05-06) (built 2015-05-05)<br>
binary: rustc<br>
commit-hash: <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/rust-lang/rust/commit/7bd71637ca40910dbd310813a19abf76db84f8f6/hovercard" href="https://github.com/rust-lang/rust/commit/7bd71637ca40910dbd310813a19abf76db84f8f6"><tt>7bd7163</tt></a><br>
commit-date: 2015-05-06<br>
build-date: 2015-05-05<br>
host: x86_64-apple-darwin<br>
release: 1.1.0-nightly</p>
<p dir="auto">Stack backtrace:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="   1:        0x10eb86f5f - sys::backtrace::write::hc8a4ac867687625dies
   2:        0x10eb8fa50 - panicking::on_panic::h8a20ee230368976dxuw
   3:        0x10eb49b45 - rt::unwind::begin_unwind_inner::hdec022e876757f01gcw
   4:        0x10eb4a96c - rt::unwind::begin_unwind_fmt::h6ffe61c334a81630mbw
   5:        0x10bd00e38 - middle::const_eval::eval_const_expr_partial::h814207524cef7390Tii
   6:        0x10b9c0aed - astconv::ast_ty_to_ty::h9119a591013371dfrSv
   7:        0x10ba41933 - collect::type_scheme_of_item::h3901b884cf3c707cdny
   8:        0x10ba39a2c - collect::convert_typed_item::h12a84069945ba57eQry
   9:        0x10ba211ad - collect::convert_item::hcb1eaa0733f02657eBx
  10:        0x10ba67b56 - check_crate::closure.38613
  11:        0x10ba65ada - check_crate::h71ec2befa9b49c1f5CC
  12:        0x10b2cff27 - driver::phase_3_run_analysis_passes::hcfdd4de2213fe030tGa
  13:        0x10b2b1c2c - driver::compile_input::h93cb3a50ed1b3f97Qba
  14:        0x10b370c93 - run_compiler::h7ca7d41460963b3165b
  15:        0x10b36e3fa - boxed::F.FnBox&lt;A&gt;::call_box::h5883147459539851824
  16:        0x10b36d957 - rt::unwind::try::try_fn::h498179752253104642
  17:        0x10ec12028 - rust_try_inner
  18:        0x10ec12015 - rust_try
  19:        0x10b36dc2d - boxed::F.FnBox&lt;A&gt;::call_box::h5554344682679983399
  20:        0x10eb8e44d - sys::thread::Thread::new::thread_start::h71342e3350e45779fxv
  21:     0x7fff921d0267 - _pthread_body
  22:     0x7fff921d01e4 - _pthread_start"><pre class="notranslate"><code class="notranslate">   1:        0x10eb86f5f - sys::backtrace::write::hc8a4ac867687625dies
   2:        0x10eb8fa50 - panicking::on_panic::h8a20ee230368976dxuw
   3:        0x10eb49b45 - rt::unwind::begin_unwind_inner::hdec022e876757f01gcw
   4:        0x10eb4a96c - rt::unwind::begin_unwind_fmt::h6ffe61c334a81630mbw
   5:        0x10bd00e38 - middle::const_eval::eval_const_expr_partial::h814207524cef7390Tii
   6:        0x10b9c0aed - astconv::ast_ty_to_ty::h9119a591013371dfrSv
   7:        0x10ba41933 - collect::type_scheme_of_item::h3901b884cf3c707cdny
   8:        0x10ba39a2c - collect::convert_typed_item::h12a84069945ba57eQry
   9:        0x10ba211ad - collect::convert_item::hcb1eaa0733f02657eBx
  10:        0x10ba67b56 - check_crate::closure.38613
  11:        0x10ba65ada - check_crate::h71ec2befa9b49c1f5CC
  12:        0x10b2cff27 - driver::phase_3_run_analysis_passes::hcfdd4de2213fe030tGa
  13:        0x10b2b1c2c - driver::compile_input::h93cb3a50ed1b3f97Qba
  14:        0x10b370c93 - run_compiler::h7ca7d41460963b3165b
  15:        0x10b36e3fa - boxed::F.FnBox&lt;A&gt;::call_box::h5883147459539851824
  16:        0x10b36d957 - rt::unwind::try::try_fn::h498179752253104642
  17:        0x10ec12028 - rust_try_inner
  18:        0x10ec12015 - rust_try
  19:        0x10b36dc2d - boxed::F.FnBox&lt;A&gt;::call_box::h5554344682679983399
  20:        0x10eb8e44d - sys::thread::Thread::new::thread_start::h71342e3350e45779fxv
  21:     0x7fff921d0267 - _pthread_body
  22:     0x7fff921d01e4 - _pthread_start
</code></pre></div>