Skip to content

Type inference regression #38323

Closed
Closed
@Arvamer

Description

@Arvamer

Following code compiles on stable but fails on nightly:

fn main() {
    let v = [1u16, 2, 3, 4];
    let idx = "1".parse().unwrap();
    println!("{:?}", v.get(idx));
}

rustc version:

rustc 1.15.0-nightly (daf8c1dfc 2016-12-05)
binary: rustc
commit-hash: daf8c1dfce3b448fc581cc319f64632ec22bd0e1
commit-date: 2016-12-05
host: x86_64-unknown-linux-gnu
release: 1.15.0-nightly
LLVM version: 3.9

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions