Skip to content

ICE - 'path not fully resolved' with type alias to an array type with undefined size #28036

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

Closed
amikhalev opened this issue Aug 27, 2015 · 2 comments

Comments

@amikhalev
Copy link

It appears that when a type alias to array type which uses an undefined constant for it's size is defined, the compiler crashes. I have only been able to reproduce this with the constants defined in uint modules.

This code

// This line prevents the crash
// use std::usize;

type Array = [usize; usize::MAX];

pub fn main() { }

Causes this ICE

$ rustc --version
rustc 1.4.0-nightly (14b7591ee 2015-08-25)

$ RUST_BACKTRACE=1 rustc test.rs
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: DefPrimTy(TyUint(usize)), last_private: LastMod(AllPublic), depth: 1 }', ../src/librustc/middle/def.rs:80

stack backtrace:
   1:        0x112c8e9b0 - sys::backtrace::tracing::imp::write::h3e935b9f3aaf3eeePbs
   2:        0x112c969db - panicking::on_panic::h957ddaa69f7f85c8gOw
   3:        0x112c5aaa2 - rt::unwind::begin_unwind_inner::hb89bb27d32753510tjw
   4:        0x112c5b82d - rt::unwind::begin_unwind_fmt::he8dabdca760d872dziw
   5:        0x10fb7f27e - middle::const_eval::eval_const_expr_partial::hf609e26a8506489cQVk
   6:        0x10f382980 - astconv::ast_ty_to_ty::h68164822b6891101Fhx
   7:        0x10f3f9b21 - collect::type_scheme_of_item::h682b0ea5c5e15cc9d8z
   8:        0x10f3f1915 - collect::convert_typed_item::hd9be457a3a816bfbYcA
   9:        0x10f3de6a5 - collect::convert_item::h608bb1b0eec4bc39d7y
  10:        0x10f3d96a6 - collect::collect_item_types::h044e5c22dac41959Jiy
  11:        0x10f425cad - check_crate::h6947ac03da7c9939BAE
  12:        0x10f0237b1 - driver::phase_3_run_analysis_passes::closure.20559
  13:        0x10f00379a - middle::ty::ctxt<'tcx>::create_and_enter::h16983514113163001088
  14:        0x10effee13 - driver::phase_3_run_analysis_passes::h14634090375742016845
  15:        0x10efe3424 - driver::compile_input::h6df79a1a00f2ec91Tba
  16:        0x10f147e01 - run_compiler::hf8bd4801a975e1fd0bc
  17:        0x10f1456e9 - boxed::F.FnBox<A>::call_box::h17883815892091822200
  18:        0x10f1450e2 - rt::unwind::try::try_fn::h1123102451065047215
  19:        0x112c96598 - __rust_try
  20:        0x112c82f60 - rt::unwind::try::inner_try::he6f08bfba5a665ddmfw
  21:        0x10f145292 - boxed::F.FnBox<A>::call_box::h10813678079818206125
  22:        0x112c9590d - sys::thread::Thread::new::thread_start::h868305d2c1b7d5304Dv
  23:     0x7fff95650267 - _pthread_body
  24:     0x7fff956501e4 - _pthread_start
@dimbleby
Copy link

Duplicate #26797? And #26922? And (closed) #27367?

@alexcrichton
Copy link
Member

Yeah I think this is definitely a duplicate of #26797, but not so sure about #26922 because it's through an associated constant. Regardless though, closing as a duplicate, thanks for the investigation @dimbleby!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants