Skip to content

rustc panic with docopt_macros #28089

Closed
Closed
@trombonehero

Description

@trombonehero

Compiling the following main.rs with rustc d877e65 (driven by rust-lang/cargo@1b902d4):

#![feature(plugin)]
#![plugin(docopt_macros)]

docopt!(Args, "
Usage: foo (--help | --version)

Options:
    -h, --help     Show this message
    --version      Show the version of foo
");

I get the following error and backtrace:

       Fresh rustc-serialize v0.3.16
       Fresh libc v0.1.10
       Fresh byteorder v0.3.11
       Fresh strsim v0.3.0
       Fresh regex-syntax v0.2.1
       Fresh pcap v0.3.2
       Fresh memchr v0.1.5
       Fresh aho-corasick v0.3.0
       Fresh regex v0.1.41
       Fresh docopt v0.6.70
   Compiling rshark v0.0.1 (file:///Volumes/Dev/rust/rusty-shark)
     Running `rustc src/main.rs --crate-name rshark --crate-type bin -g --out-dir /Volumes/Dev/rust/rusty-shark/target/debug --emit=dep-info,link -L dependency=/Volumes/Dev/rust/rusty-shark/target/debug -L dependency=/Volumes/Dev/rust/rusty-shark/target/debug/deps --extern rustc_serialize=/Volumes/Dev/rust/rusty-shark/target/debug/deps/librustc_serialize-7ff5bfc027146194.rlib --extern byteorder=/Volumes/Dev/rust/rusty-shark/target/debug/deps/libbyteorder-4fce7f4e6a3a7971.rlib --extern docopt_macros=/Volumes/Dev/rust/rusty-shark/target/debug/deps/libdocopt_macros-a6de226da2d2dbee.dylib --extern docopt=/Volumes/Dev/rust/rusty-shark/target/debug/deps/libdocopt-faaff1fb4e49b8d3.rlib --extern pcap=/Volumes/Dev/rust/rusty-shark/target/debug/deps/libpcap-a15489e5f8e0ae99.rlib --extern rshark=/Volumes/Dev/rust/rusty-shark/target/debug/librshark.rlib`
       Fresh docopt_macros v0.6.70
thread 'rustc' panicked at 'index out of bounds: the len is 60 but the index is 65', src/libcollections/vec.rs:1261

stack backtrace:
   1:        0x10892ad95 - sys::backtrace::write::hb66fe514ff57da79Yws
   2:        0x108933e9e - panicking::on_panic::h1391145d0b989950GXw
   3:        0x1088ed882 - rt::unwind::begin_unwind_inner::hb494f9df36a862c1RFw
   4:        0x1088ee75c - rt::unwind::begin_unwind_fmt::h52e6b4971e042d46XEw
   5:        0x108933a1c - rust_begin_unwind
   6:        0x1089853f5 - panicking::panic_fmt::hd75b6cee85f3afe4SgC
   7:        0x10897fb35 - panicking::panic_bounds_check::h75be7bf05a80539eYfC
   8:        0x10e1450f5 - parse::token::InternedString::new_from_name::h8111e5682fc45ad3FkT
   9:        0x10e20bf18 - parse::parser::Parser<'a>::lit_from_token::h0d07f04eeabf23bchNG
  10:        0x10e210757 - parse::parser::Parser<'a>::parse_lit::haa0eebf06d59b0d9lRG
  11:        0x10e2166f0 - parse::parser::Parser<'a>::parse_bottom_expr::h7495fdc246becf10smH
  12:        0x10e21c172 - parse::parser::Parser<'a>::parse_dot_or_call_expr::hf83bae54e6ee28e41PH
  13:        0x10e220253 - parse::parser::Parser<'a>::parse_prefix_expr::h6dcba969e9fcdfa6ejI
  14:        0x10e2210e2 - parse::parser::Parser<'a>::parse_binops::ha6fcf1d22eba030e5tI
  15:        0x10e221b0b - parse::parser::Parser<'a>::parse_assign_expr::h1237d11d5bcb411eXzI
  16:        0x10e1ef991 - parse::parser::Parser<'a>::parse_expr::hf4118a56a6da097cc6E
  17:        0x10d2b05df - MacParser<'a, 'b>::parse_str::hdb359ba5b83664ee8ra
  18:        0x10d232aa7 - MacParser<'a, 'b>::parse::h134ebf17f8af49ccuoa
  19:        0x10d2325c2 - expand::hb4b7305ba726be863aa
  20:        0x10dbc3d0e - ext::base::F.TTMacroExpander::expand::h15442948462285585430
  21:        0x10674e06a - ext::expand::expand_item_mac::h70316ca4f5b12b7dYRb
  22:        0x10673d820 - ext::expand::expand_annotatable::h670bc4d68c7340e44lc
  23:        0x106739e0d - ext::expand::expand_item::h1d57b59c88ed776dWOb
  24:        0x1067463eb - fold::noop_fold_mod::closure.66426
  25:        0x10674606c - iter::FlatMap<I, U, F>.Iterator::next::h7787021719063519280
  26:        0x106745ab5 - vec::Vec<T>.FromIterator<T>::from_iter::h8769822404114346174
  27:        0x106745845 - fold::Folder::fold_mod::h12688539743151791588
  28:        0x106740ad8 - ext::expand::expand_item_underscore::ha6887def1d44464dxPb
  29:        0x106793772 - fold::noop_fold_item_simple::h12171689993025331003
  30:        0x1067932f6 - fold::noop_fold_item::h236170770538799404
  31:        0x10673ec75 - ext::expand::expand_annotatable::h670bc4d68c7340e44lc
  32:        0x106739e0d - ext::expand::expand_item::h1d57b59c88ed776dWOb
  33:        0x10679ad8f - ext::expand::expand_crate::h1cdd399411e3b25bUNc
  34:        0x105198815 - driver::phase_2_configure_and_expand::closure.22401
  35:        0x10514b5e3 - driver::phase_2_configure_and_expand::h2b5eb3aac7e23d4cita
  36:        0x10513c0c5 - driver::compile_input::h6ff6de4909e0ced5Tba
  37:        0x105220210 - run_compiler::h855428a6f31812ebA7b
  38:        0x10521dca0 - boxed::F.FnBox<A>::call_box::h1402838733596026107
  39:        0x10521d517 - rt::unwind::try::try_fn::h10520533051806862779
  40:        0x10893394f - __rust_try_inner
  41:        0x10893398a - __rust_try
  42:        0x10891d305 - rt::unwind::try::inner_try::hfce8c2a882970c4aKBw
  43:        0x10521d759 - boxed::F.FnBox<A>::call_box::h4757993596228899159
  44:        0x10893292d - sys::thread::Thread::new::thread_start::h477ee10709502668l0v
  45:     0x7fff94b9f267 - _pthread_body
  46:     0x7fff94b9f1e4 - _pthread_start

This might be a duplicate of one of the "me too" reports on #24819, but I don't think it's a duplicate of originally-reported issue.

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