Skip to content

ICE when using for comprehension against @[] #3381

Closed
@JamilH

Description

@JamilH

Here is the code producing internal compiler error

import io::*;

fn main(){
    let name = @["my","name","is","khan"]; 
    for name.each |el| {
        println(el)
    }
}

also issue #2797 needs to be reopened because

fn foo(_x: &[int]) {}
fn main() {
    let x = @[1,2,3];
    foo(x);
}

fails with the same error

╰─$ rustc -v                                                                                                             
rustc 0.3.1
host: x86_64-unknown-linux-gnu

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-type-systemArea: Type systemI-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions