Skip to content

[ICE] error during interning #72372

Closed
@leonardo-m

Description

@leonardo-m

This code:

fn main() {
    let foo = "1\n2".lines().map(|_| [1]);
    let _ = foo.filter(|_| true);
}

Compiling it with rustc -Z mir-opt-level=2 test.rs gives:

error: internal compiler error: error during interning should later cause validation failure
 --> test.rs:3:13
  |
3 |     let _ = foo.filter(|_| true);
  |             ^^^

error: internal compiler error: error during interning should later cause validation failure
   --> ...\lib/rustlib/src/rust\src\libcore\iter\traits\iterator.rs:730:21
    |
730 |         Filter::new(self, predicate)
    |                     ^^^^

error: internal compiler error: error during interning should later cause validation failure
   --> ...\lib/rustlib/src/rust\src\libcore\iter\adapters\mod.rs:912:18
    |
912 |         Filter { iter, predicate }
    |                  ^^^^

thread 'rustc' panicked at 'no errors encountered even though `delay_span_bug` issued', src\librustc_errors\lib.rs:366:17
stack backtrace:
 ...

Using:

rustc 1.45.0-nightly (3a7dfda40 2020-05-19)
binary: rustc
commit-hash: 3a7dfda40a3e798bf086bd58cc7e5e09deb808b5
commit-date: 2020-05-19
host: x86_64-pc-windows-gnu
release: 1.45.0-nightly
LLVM version: 9.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-mir-optArea: MIR optimizationsC-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.glacierICE tracked in rust-lang/glacier.requires-nightlyThis issue requires a nightly compiler in some way.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions