Skip to content

ICE: RangeInclusive broken in nightly-2018-05-02? #50415

Closed
@kamyuentse

Description

@kamyuentse

I tried this code:

fn main() {
    let full_length = 1024;
    let range = {
        // do some stuff, omit here
        None
    };
    
    let range = range.map(|(s, t)| s..=t).unwrap_or(0..=(full_length-1));
    
    println!("{:?}", range);
}

Which expected prints 0..=1023(work fine under beta channel), while, I got ICE:

error: internal compiler error: librustc/hir/map/mod.rs:329: local_def_id: no entry for `25`, which has a map of `Some(EntryTy(NodeId(71), 3, type(::std::ops::RangeInclusive)))`

playground

Metadata

Metadata

Assignees

Labels

C-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️P-highHigh priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions