Skip to content

ICE while declaring fixed-sized array depending on the item in the same struct #27829

Closed
@Burgos

Description

@Burgos
struct Generic
{
    pub size: u32,
    pub data: [u32; Generic::ckSize]
}

#[test]
fn it_works() {
}

Outputs:

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
thread 'rustc' panicked at 'path not fully resolved: PathResolution { base_def: DefTy(DefId { krate: 0, node: 4 }Generic, false), last_private: LastMod(AllPublic), depth: 1 }', ../src/librustc/middle/def.rs:81

stack backtrace:
   1:     0x7ff49b3a2c4e - sys::backtrace::write::h31b60a04d5b9a81ckqs
   2:     0x7ff49b3aaaf4 - panicking::on_panic::haca2ec19b0bb0f31B8w
   3:     0x7ff49b36d63e - rt::unwind::begin_unwind_inner::h384bd76ff13d8e66fOw
   4:     0x7ff49b36e36c - rt::unwind::begin_unwind_fmt::hf78032cbbe2296b5lNw
   5:     0x7ff49939a609 - middle::const_eval::eval_const_expr_with_substs::h8711612950228028103
   6:     0x7ff49934b8fb - middle::const_eval::eval_const_expr_partial::h2888eb9e479733e9HLk
   7:     0x7ff49ab7f2b9 - astconv::ast_ty_to_ty::hf914e7106582dfb2V8v
   8:     0x7ff49abf9d43 - iter::Map<I, F>.Iterator::next::h11406412909731951195
   9:     0x7ff49abed76d - collect::convert_struct::haabb2717fa36449ePly
  10:     0x7ff49abdeb55 - collect::convert_item::h2cca9c39f6b8d796R0x
  11:     0x7ff49abd9f17 - collect::collect_item_types::hf0bc00065ee6508bW7w
  12:     0x7ff49ac2972b - check_crate::hc77ba823ce7b03a29fD
  13:     0x7ff49b906549 - driver::phase_3_run_analysis_passes::closure.15761
  14:     0x7ff49b9049da - middle::ty::with_ctxt::h6668214031915206547
  15:     0x7ff49b8ff797 - driver::phase_3_run_analysis_passes::h7079152999418445164
  16:     0x7ff49b8e1ff6 - driver::compile_input::h68c27ba828e71325Tba
  17:     0x7ff49b9beaf3 - run_compiler::h21d74b88eec3fe3bx7b
  18:     0x7ff49b9bc4ce - boxed::F.FnBox<A>::call_box::h16056439662428537931
  19:     0x7ff49b9bbd19 - rt::unwind::try::try_fn::h6148543393464578718
  20:     0x7ff49b422e58 - rust_try_inner
  21:     0x7ff49b422e45 - rust_try
  22:     0x7ff49b395ec7 - rt::unwind::try::inner_try::h472293c152f3b97e8Jw
  23:     0x7ff49b9bbf2b - boxed::F.FnBox<A>::call_box::h18323747056190398050
  24:     0x7ff49b3a9751 - sys::thread::Thread::new::thread_start::hed666015e7925bf95Tv
  25:     0x7ff495a16e99 - start_thread
  26:     0x7ff49aff438c - <unknown>

rustc 1.2.0 (082e47636 2015-08-03)

Metadata

Metadata

Assignees

No one assigned

    Labels

    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