Skip to content

ICE during macro expansion: index out of bounds: the len is 5 but the index is 5 #17084

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
japaric opened this issue Sep 7, 2014 · 1 comment
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@japaric
Copy link
Member

japaric commented Sep 7, 2014

STR

use std::io::MemWriter;

fn main() {
    let (foo, bar) = ((), ());
    let ref mut sink = MemWriter::new();
    // OK
    (writeln!(sink, "{} {}", foo, bar)).unwrap();
    // ICE
    (writeln!(sink, "{} {}", foo), bar).unwrap();
    //                             ^~ misplaced the `bar` argument
}

Version

rustc 0.12.0-pre (4067252de 2014-09-07 14:31:24 +0000)

Backtrace

task 'rustc' failed at 'index out of bounds: the len is 5 but the index is 5', /var/tmp/paludis/build/dev-lang-rust-scm/work/rust-scm/src/libsyntax/lib.rs:1

stack backtrace:
   1:     0x7f26c413cde0 - rt::backtrace::imp::write::h23751f5ff57d310aH8q
   2:     0x7f26c413ff80 - <unknown>
   3:     0x7f26c491b610 - unwind::begin_unwind_inner::hc65add009f437d5162d
   4:     0x7f26c491b100 - unwind::begin_unwind_fmt::hf241d83f5d83b087q0d
   5:     0x7f26c491b0c0 - rust_begin_unwind
   6:     0x7f26c495b490 - failure::begin_unwind::hb3e4116c2b1c26d7Wnk
   7:     0x7f26c495b340 - failure::fail_bounds_check::hf4e753cfc0d53aecSkk
   8:     0x7f26c043cd10 - codemap::FileMap::get_line::h1b3e37e16ad1df99pjE
   9:     0x7f26c04468e0 - <unknown>
  10:     0x7f26c0443a40 - diagnostic::EmitterWriter.Emitter::emit::h3aaf2cc69b2a54f8nCF
  11:     0x7f26c0442170 - diagnostic::Handler::emit::he175888aeefb5595ajF
  12:     0x7f26c03bc070 - ext::base::ExtCtxt<'a>::span_err::hdd76f90faf79a373OJ3
  13:     0x7f26c05a3450 - <unknown>
  14:     0x7f26c051f6f0 - ext::format::expand_preparsed_format_args::h7606b70b827955c6K4b
  15:     0x7f26c04d00f0 - ext::format::expand_format_args_method::h6f7281d7e34d1b7aK3b
  16:     0x7f26c04ccf20 - ext::base::BasicMacroExpander.TTMacroExpander::expand::h7c75fe04d027d993lm3
  17:     0x7f26c054bfe0 - <unknown>
  18:     0x7f26c0556680 - <unknown>
  19:     0x7f26c0555020 - ext::expand::MacroExpander<'a, 'b>.Folder::fold_block::h8da21186045129c9uUa
  20:     0x7f26c0551ae0 - <unknown>
  21:     0x7f26c054bfe0 - <unknown>
  22:     0x7f26c04dc510 - ext::expand::MacroExpander<'a, 'b>.Folder::fold_expr::hefc0d51927d8bb7dSSa
  23:     0x7f26c054bfe0 - <unknown>
  24:     0x7f26c04dc510 - ext::expand::MacroExpander<'a, 'b>.Folder::fold_expr::hefc0d51927d8bb7dSSa
  25:     0x7f26c054bfe0 - <unknown>
  26:     0x7f26c04dc510 - ext::expand::MacroExpander<'a, 'b>.Folder::fold_expr::hefc0d51927d8bb7dSSa
  27:     0x7f26c04f29a0 - <unknown>
  28:     0x7f26c0551ae0 - <unknown>
  29:     0x7f26c054bfe0 - <unknown>
  30:     0x7f26c04dc510 - ext::expand::MacroExpander<'a, 'b>.Folder::fold_expr::hefc0d51927d8bb7dSSa
  31:     0x7f26c0553700 - <unknown>
  32:     0x7f26c04f29a0 - <unknown>
  33:     0x7f26c0551ae0 - <unknown>
  34:     0x7f26c054bfe0 - <unknown>
  35:     0x7f26c04dc510 - ext::expand::MacroExpander<'a, 'b>.Folder::fold_expr::hefc0d51927d8bb7dSSa
  36:     0x7f26c05732e0 - <unknown>
  37:     0x7f26c0561bd0 - <unknown>
  38:     0x7f26c05653e0 - ext::expand::MacroExpander<'a, 'b>.Folder::fold_stmt::hd1c3456308c75fdc9Ta
  39:     0x7f26c057a340 - <unknown>
  40:     0x7f26c0556680 - <unknown>
  41:     0x7f26c0555020 - ext::expand::MacroExpander<'a, 'b>.Folder::fold_block::h8da21186045129c9uUa
  42:     0x7f26c0550de0 - <unknown>
  43:     0x7f26c055d270 - ext::expand::MacroExpander<'a, 'b>.Folder::fold_item_underscore::h27f572d5760062f3STa
  44:     0x7f26c055cf30 - <unknown>
  45:     0x7f26c0557130 - <unknown>
  46:     0x7f26c055f9f0 - ext::expand::MacroExpander<'a, 'b>.Folder::fold_item::h2bcc44b49b9c9d1awTa
  47:     0x7f26c055f990 - <unknown>
  48:     0x7f26c04fe200 - <unknown>
  49:     0x7f26c055ef60 - <unknown>
  50:     0x7f26c058e8b0 - ext::expand::expand_crate::hd9a395f29defc8adpWa
  51:     0x7f26c55ed510 - <unknown>
  52:     0x7f26c53e3300 - driver::driver::phase_2_configure_and_expand::h6fe4676a48aa874bdzD
  53:     0x7f26c55af2c0 - driver::driver::compile_input::h86a4be38205dedd4EsD
  54:     0x7f26c5640b60 - <unknown>
  55:     0x7f26c5640a50 - <unknown>
  56:     0x7f26c4d2d350 - <unknown>
  57:     0x7f26c4d2d150 - <unknown>
  58:     0x7f26c60ea4d0 - <unknown>
  59:     0x7f26c4968de0 - <unknown>
  60:     0x7f26c4968dd0 - rust_try
  61:     0x7f26c4918ce0 - unwind::try::h2eddd5244ebec084gRd
  62:     0x7f26c4918b40 - task::Task::run::hf7cea9fec0a760e292c
  63:     0x7f26c60ea240 - <unknown>
  64:     0x7f26c491a6c0 - <unknown>
  65:     0x7f26c3bf8000 - start_thread
  66:     0x7f26c45e9ec9 - clone
  67:                0x0 - <unknown>
@steveklabnik steveklabnik added the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label Sep 22, 2014
@alexcrichton
Copy link
Member

Closing as a dupe of #14091

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

3 participants