Skip to content

type parameter V/#2 (V/2) out of range when substituting with MIR inlining enabled #78529

Closed
@tmiasko

Description

@tmiasko
env RUSTFLAGS=-Zmir-opt-level=2 cargo check -Zbuild-std --target x86_64-unknown-linux-gnu

Error output

error: internal compiler error: compiler/rustc_middle/src/ty/subst.rs:528:17: type parameter `V/#2` (V/2) out of range when substituting, substs=[fn() -> collections::btree::node::Root<K, V> {collections::btree::node::Root::<K, V>::new_leaf}, ()]

thread 'rustc' panicked at 'Box<Any>', /rustc/0da6d42f297642a60f2640ec313b879b376b9ad8/compiler/rustc_errors/src/lib.rs:891:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.49.0-nightly (0da6d42f2 2020-10-26) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z force-unstable-if-unmarked -Z mir-opt-level=2 -C embed-bitcode=no -C debuginfo=2 --crate-type lib

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
#0 [optimized_mir] optimizing MIR for `<collections::btree::map::BTreeMap<K, V> as core::clone::Clone>::clone::clone_subtree`
#1 [optimized_mir] optimizing MIR for `<collections::btree::map::BTreeMap<K, V> as core::clone::Clone>::clone`

Regressed in #68965, cc @eddyb.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-mir-opt-inliningArea: MIR inliningC-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.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions