Skip to content

Index out of bounds panic when compiling project #54582

Closed
@hallcristobal

Description

@hallcristobal

When compiling my project TPGZ
on the branch "crashing" (which just has a lot of irrelevant things commented out) commenting out this array https://github.com/hallcristobal/TwilightPrincessDebugMenu/blob/b629f10f29810c3db4c5205619d71c79e552de1b/src/warping/statics/cave.rs#L53
(and the same similar arrays from the other files in that directory) causes it to not crash.

Meta

rustc --version --verbose:
rustc 1.30.0-nightly (2224a42 2018-09-17)
binary: rustc
commit-hash: 2224a42
commit-date: 2018-09-17
host: x86_64-pc-windows-msvc
release: 1.30.0-nightly
LLVM version: 8.0

Backtrace:

thread 'main' panicked at 'index out of bounds: the len is 0 but the index is 0', libcore\slice\mod.rs:2046:10
stack backtrace:
   0: <std::sys::windows::args::Args as core::ops::drop::Drop>::drop
   1: std::io::error::Error::get_ref
   2: std::panicking::take_hook
   3: std::panicking::take_hook
   4: <rustc::ty::sty::Binder<rustc::ty::ProjectionPredicate<'tcx>> as rustc::ty::ToPredicate<'tcx>>::to_predicate
   5: std::panicking::rust_panic_with_hook
   6: std::panicking::begin_panic_fmt
   7: rust_begin_unwind
   8: core::panicking::panic_fmt
   9: core::panicking::panic_bounds_check
  10: <rustc_lint::nonstandard_style::NonUpperCaseGlobals as rustc::lint::LateLintPass<'a, 'tcx>>::check_pat
  11: <rustc_lint::builtin::TypeAliasBounds as rustc::lint::LateLintPass<'a, 'tcx>>::check_item
  12: <rustc_lint::register_builtins::BuiltinCombinedLateLintPass as rustc::lint::LateLintPass<'a, 'tcx>>::check_item
  13: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_item
  14: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_mod
  15: rustc::hir::intravisit::NestedVisitorMap::inter
  16: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_item
  17: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_mod
  18: rustc::hir::intravisit::NestedVisitorMap::inter
  19: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_item
  20: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_mod
  21: rustc::hir::intravisit::NestedVisitorMap::inter
  22: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_item
  23: <rustc::lint::context::LateContext<'a, 'tcx> as rustc::hir::intravisit::Visitor<'tcx>>::visit_mod
  24: rustc::hir::intravisit::NestedVisitorMap::inter
  25: rustc::lint::context::check_crate
  26: <unknown>
  27: <rustc_driver::pretty::NoAnn<'hir> as rustc_driver::pretty::HirPrinterSupport<'hir>>::sess
  28: <rustc_driver::CompilationFailure as core::fmt::Debug>::fmt
  29: rustc_driver::driver::compile_input
  30: rustc_driver::run_compiler
  31: rustc_driver::target_features::add_configuration
  32: rustc_driver::run_compiler
  33: rustc_driver::target_features::add_configuration
  34: _rust_maybe_catch_panic
  35: rustc_driver::profile::dump
  36: rustc_driver::main
  37: <unknown>
  38: std::panicking::update_panic_count
  39: _rust_maybe_catch_panic
  40: std::rt::lang_start_internal
  41: <unknown>
  42: <unknown>
  43: BaseThreadInitThunk
  44: RtlUserThreadStart
query stack during panic:
end of query stack

Metadata

Metadata

Assignees

No one assigned

    Labels

    E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions