Out of bounds panics on map assignments
Stacktraces and repros looks similar, so I grouped them together.
Reproduction #1:
let map['='] = '='
Panics with: thread 'main' panicked at 'byte index 9 is out of bounds of "'] = '='"', src/libcore/str/mod.rs:2027:9
Stacktrace
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::str::slice_error_fail at src/libcore/str/mod.rs:0 9: core::str::traits:: for core::ops::range::Range>::index::{{closure}} at /rustc/4c2be9c97fb60a01c545b8e8fa61e4247ae5c9b2/src/libcore/str/mod.rs:1768 10: >::unwrap_or_else at /rustc/4c2be9c97fb60a01c545b8e8fa61e4247ae5c9b2/src/libcore/option.rs:386 11: core::str::traits:: for core::ops::range::Range>::index at /rustc/4c2be9c97fb60a01c545b8e8fa61e4247ae5c9b2/src/libcore/str/mod.rs:1768 12: core::str::traits:: for str>::index at /rustc/4c2be9c97fb60a01c545b8e8fa61e4247ae5c9b2/src/libcore/str/mod.rs:1633 13: as core::iter::iterator::Iterator>::next at members/lexers/src/arguments.rs:148 14: as core::iter::iterator::Iterator>::next at src/lib/parser/assignments/actions.rs:79 15: ::local at src/lib/shell/assignments.rs:167 16: ::execute_statement at src/lib/shell/flow.rs:181 17: ::on_command at src/lib/shell/flow.rs:491 18: ion_shell::shell::binary::terminate::terminate_script_quotes at /home/tibor/git/ion/src/lib/shell/binary/terminate.rs:37 19: ::terminate_script_quotes at /home/tibor/git/ion/src/lib/shell/binary/mod.rs:165 20: ion_shell::shell::Shell::execute_script at /home/tibor/git/ion/src/lib/shell/mod.rs:207 21: ion::main at src/main.rs:54 22: std::rt::lang_start::{{closure}} at /rustc/4c2be9c97fb60a01c545b8e8fa61e4247ae5c9b2/src/libstd/rt.rs:64 23: std::panicking::try::do_call at src/libstd/rt.rs:49 at src/libstd/panicking.rs:297 24: __rust_maybe_catch_panic at src/libpanic_unwind/lib.rs:92 25: std::rt::lang_start_internal at src/libstd/panicking.rs:276 at src/libstd/panic.rs:388 at src/libstd/rt.rs:48 26: std::rt::lang_start at /rustc/4c2be9c97fb60a01c545b8e8fa61e4247ae5c9b2/src/libstd/rt.rs:64 27: main 28: __libc_start_main 29: _start
Reproduction #2:
let map[=]
Panics with: thread 'main' panicked at 'index out of bounds: the len is 4 but the index is 4', members/lexers/src/assignments/keys.rs:67:16
Stacktrace
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_lexers::assignments::keys::KeyIterator::parse_array at members/lexers/src/assignments/keys.rs:67 10: as core::iter::iterator::Iterator>::next at members/lexers/src/assignments/keys.rs:153 11: as core::iter::iterator::Iterator>::next at src/lib/parser/assignments/actions.rs:78 12: ::local at src/lib/shell/assignments.rs:167 13: ::execute_statement at src/lib/shell/flow.rs:181 14: ::on_command at src/lib/shell/flow.rs:491 15: ion_shell::shell::binary::terminate::terminate_script_quotes at /home/tibor/git/ion/src/lib/shell/binary/terminate.rs:37 16: ::terminate_script_quotes at /home/tibor/git/ion/src/lib/shell/binary/mod.rs:165 17: ion_shell::shell::Shell::execute_script at /home/tibor/git/ion/src/lib/shell/mod.rs:207 18: ion::main at src/main.rs:54 19: std::rt::lang_start::{{closure}} at /rustc/4c2be9c97fb60a01c545b8e8fa61e4247ae5c9b2/src/libstd/rt.rs:64 20: std::panicking::try::do_call at src/libstd/rt.rs:49 at src/libstd/panicking.rs:297 21: __rust_maybe_catch_panic at src/libpanic_unwind/lib.rs:92 22: std::rt::lang_start_internal at src/libstd/panicking.rs:276 at src/libstd/panic.rs:388 at src/libstd/rt.rs:48 23: std::rt::lang_start at /rustc/4c2be9c97fb60a01c545b8e8fa61e4247ae5c9b2/src/libstd/rt.rs:64 24: main 25: __libc_start_main 26: _start
Build information:
rustc -V
: rustc 1.33.0-nightly (4c2be9c97 2019-01-22)
git rev-parse HEAD
: 918e1fc4