Skip to content

Compiler panic: 'index out of bounds' #24819

Closed
@gsingh93

Description

@gsingh93

Playpen link: http://is.gd/LITiE8
Example:

use std::collections::HashSet;

fn main() {
    let mut v = Vec::new();
    foo(&mut v);
}

fn foo(h: &mut HashSet<u32>) {
}

Output from playpen:

<anon>:5:9: 5:15 error: mismatched types:
 expected `&mut std::collections::hash::set::HashSet<u32>`,
    found `&mut collections::vec::Vec<_>`
(expected struct `std::collections::hash::set::HashSet`,
    found struct `collections::vec::Vec`) [E0308]
<anon>:5     foo(&mut v);
                 ^~~~~~
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 3 but the index is 3', /home/rustbuild/src/rust-buildbot/slave/beta-dist-rustc-linux/build/src/libcollections/vec.rs:1358


playpen: application terminated with error code 101
Program ended.

Happens for me on rustc 1.1.0-nightly (f9e53c7f2 2015-04-24) (built 2015-04-25), and playpen is using beta, so it happens on that as well.

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