Skip to content

Compiler panic when building a Piston example #25801

Closed

Description

@yzsolt

I tried to compile the "paint" Piston example and it caused a compiler panic.

Here's the output of cargo build (with backtrace):

Compiling piston-example-paint v0.0.1 (file:///home/yzsolt/piston-examples/paint)
src/main.rs:25:43: 25:49 error: mismatched types:
 expected `&image::buffer::ImageBuffer<image::color::Rgba<u8>, collections::vec::Vec<u8>>`,
    found `&image::buffer::ImageBuffer<_, collections::vec::Vec<_>>`
(expected struct `image::buffer::ImageBuffer`,
    found a different struct `image::buffer::ImageBuffer`) [E0308]
src/main.rs:25     let mut texture = Texture::from_image(&image);
                                                         ^~~~~~
error: internal compiler error: unexpected panic
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
note: run with `RUST_BACKTRACE=1` for a backtrace
thread 'rustc' panicked at 'index out of bounds: the len is 37 but the index is 37', /build/rust/src/rustc-1.0.0/src/libcollections/vec.rs:1322

stack backtrace:
   1:     0x7f23d8dec189 - sys::backtrace::write::h85e36588f6ec519ed4r
   2:     0x7f23d8df3e96 - panicking::on_panic::h6e154bbd20295560jrw
   3:     0x7f23d8db71a2 - rt::unwind::begin_unwind_inner::h58d8677c31c147e6t6v
   4:     0x7f23d8db7e4c - rt::unwind::begin_unwind_fmt::h924efd716b4278c074v
   5:     0x7f23d8df3a76 - rust_begin_unwind
   6:     0x7f23d8e37274 - panicking::panic_fmt::he302f86ae5ca12d0wwy
   7:     0x7f23d8e412ac - panicking::panic_bounds_check::h0006437796ea41ccCvy
   8:     0x7f23d6e8f61e - middle::infer::freshen::TypeFreshener<'a, 'tcx>.TypeFolder<'tcx>::fold_ty::hd03be5b5df7cb4cd3kx
   9:     0x7f23d6e90a09 - middle::ty_fold::TypeFolder::fold_substs::h13506550789086939651
  10:     0x7f23d6f0abfc - middle::traits::select::SelectionContext<'cx, 'tcx>::select::ha27324e58b941879vhR
  11:     0x7f23d6f08601 - middle::traits::fulfill::FulfillmentContext<'tcx>::select::h24418ff3661cf949G9O
  12:     0x7f23d6f07bfb - middle::traits::fulfill::FulfillmentContext<'tcx>::select_where_possible::h1b1b20a693127c22U8O
  13:     0x7f23d7bd68a8 - check::vtable::select_fcx_obligations_where_possible::h6ed02761439d9a31r5b
  14:     0x7f23d7bf491a - check::FnCtxt<'a, 'tcx>::resolve_type_vars_if_possible::h2b039f2e722e94c1Vwo
  15:     0x7f23d7bfb60e - check::demand::coerce::h5b1ebb0eeb6f28407Hf
  16:     0x7f23d7c9313b - check::check_expr_with_unifier::h13999909920734200217
  17:     0x7f23d7cb8dcb - check::check_decl_local::hcf2fbd7dd5722f7chOr
  18:     0x7f23d7c63821 - check::check_block_with_expected::h9c0ca1993108b874nUr
  19:     0x7f23d7c46376 - check::check_fn::ha75f672cf1690b53UGn
  20:     0x7f23d7c5f244 - check::check_bare_fn::h16e5c54944c58ce3twn
  21:     0x7f23d7c5d3a2 - check::CheckItemBodiesVisitor<'a, 'tcx>.Visitor<'tcx>::visit_item::h960d90c3a6588469wtn
  22:     0x7f23d7d2134a - check_crate::closure.38028
  23:     0x7f23d7d1c6e0 - check_crate::h16da0c29bfd97789XcC
  24:     0x7f23d9326a08 - driver::phase_3_run_analysis_passes::h7268293564f4d974nGa
  25:     0x7f23d9307b05 - driver::compile_input::hf89ed7761a9a5930Qba
  26:     0x7f23d93c8fd1 - run_compiler::h61cd16b138828888z4b
  27:     0x7f23d93c6c22 - boxed::F.FnBox<A>::call_box::h3676213088059194772
  28:     0x7f23d93c6159 - rt::unwind::try::try_fn::h2238843044414567073
  29:     0x7f23d8e5db28 - rust_try_inner
  30:     0x7f23d8e5db15 - rust_try
  31:     0x7f23d93c6408 - boxed::F.FnBox<A>::call_box::h6492341214887270608
  32:     0x7f23d8df2d81 - sys::thread::create::thread_start::ha66925ca4f47d19baqv
  33:     0x7f23d387e353 - start_thread
  34:     0x7f23d8a4cbfc - __clone
  35:                0x0 - <unknown>

Could not compile `piston-example-paint`.

Output of rustc --version --verbose:

rustc 1.0.0-dev (built 2015-05-17)
binary: rustc
commit-hash: unknown
commit-date: unknown
build-date: 2015-05-17
host: x86_64-unknown-linux-gnu
release: 1.0.0-dev

(This is the official rust package for Arch Linux)

Activity

  1. added
    I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
    on May 26, 2015
  2. arielb1 commented on Jun 29, 2015

    @arielb1
    Contributor
  3. added a commit that references this issue on May 24, 2016
    c209d44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️P-highHigh priority

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions