Skip to content

index out of bounds: the len is 1 but the index is 1 #10955

Closed
@apoelstra

Description

@apoelstra

There is another bug by the same name, but that one was fixed. After searching about 10 minutes, I couldn't find any duplicates.

The code

fn main () {
    let arr: ~[u8] = ~[ 1, 2, 3 ];
    let iter = &arr.iter() as &Iterator<&u8>
}

Fails to compile with the following error

task 'rustc' failed at 'index out of bounds: the len is 1 but the index is 1', /home/username/dload/code/rust/src/librustc/middle/ty.rs:1432
error: internal compiler error: unexpected failure
This message reflects a bug in the Rust compiler. 
We would appreciate a bug report: https://github.com/mozilla/rust/wiki/HOWTO-submit-a-Rust-bug-report
note: the compiler hit an unexpected failure path. this is a bug
note: try running with RUST_LOG=rustc=1 to get further details and report the results to github.com/mozilla/rust/issues
task '' failed at 'explicit failure', /home/username/dload/code/rust/src/librustc/lib.rs:398

I am running rustc 0.9-pre (e5f4904 2013-12-13 07:51:42 -0800) on Fedora 19 (Linux 3.11.6-200.fc19.x86_64 #1 SMP). This is latest git HEAD as of about an hour ago.

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