`let` panics when there are empty array variables in the shell
The let
builtin is panicking with an index out of bounds
panic when there are empty array variables within the shell.
Reproduction:
let x = []
let
Build information:
rustc -V
: rustc 1.33.0-nightly (4c2be9c97 2019-01-22)
git rev-parse HEAD
: 32319d7b
Stacktrace:
Stacktrace
thread 'main' panicked at 'index out of bounds: the len is 0 but the index is 0', src/lib/shell/assignments.rs:40:41 stack backtrace: 0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace at src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:39 1: std::sys_common::backtrace::_print at src/libstd/sys_common/backtrace.rs:70 2: std::panicking::default_hook::{{closure}} at src/libstd/sys_common/backtrace.rs:58 at src/libstd/panicking.rs:200 3: std::panicking::default_hook at src/libstd/panicking.rs:215 4: std::panicking::rust_panic_with_hook at src/libstd/panicking.rs:478 5: std::panicking::continue_panic_fmt at src/libstd/panicking.rs:385 6: rust_begin_unwind at src/libstd/panicking.rs:312 7: core::panicking::panic_fmt at src/libcore/panicking.rs:85 8: core::panicking::panic_bounds_check at src/libcore/panicking.rs:61 9: ion_shell::shell::assignments::list_vars::print_array at src/lib/shell/assignments.rs:40 10: ion_shell::shell::assignments::list_vars at src/lib/shell/assignments.rs:53 11: ::local at src/lib/shell/assignments.rs:159 12: ::execute_statement at src/lib/shell/flow.rs:181 13: ::on_command at src/lib/shell/flow.rs:491 14: ::execute_interactive at src/lib/shell/binary/mod.rs:120 15: ion::main at src/main.rs:66 16: std::rt::lang_start::{{closure}} at /rustc/4c2be9c97fb60a01c545b8e8fa61e4247ae5c9b2/src/libstd/rt.rs:64 17: std::panicking::try::do_call at src/libstd/rt.rs:49 at src/libstd/panicking.rs:297 18: __rust_maybe_catch_panic at src/libpanic_unwind/lib.rs:92 19: std::rt::lang_start_internal at src/libstd/panicking.rs:276 at src/libstd/panic.rs:388 at src/libstd/rt.rs:48 20: std::rt::lang_start at /rustc/4c2be9c97fb60a01c545b8e8fa61e4247ae5c9b2/src/libstd/rt.rs:64 21: main 22: __libc_start_main 23: _start