Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ICE const parameter... out of range when substituting substs=[_, alloc::Global] #105573

Closed
peter-lyons-kehl opened this issue Dec 11, 2022 · 9 comments
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@peter-lyons-kehl
Copy link
Contributor

peter-lyons-kehl commented Dec 11, 2022

Hi dear rustc team member. Thank you for Rust.

SUMMARY

This error comes when compiling my proof-of-concept fork of Rust. I've extended Vec, VecDeque, RawVec and related internal structs to have an extra, optional, const generic parameter (COOP_PREFERRED). I did modify some compiler tests, but only so that it passes to build (very hacky - work in progress). (The actual motivation & goal itself will be very controversial: cooperative allocations; but hopefully beneficial.)

ENVIRONMENT

Current Manjaro (Arch sister) Linux on x86_64: 5.19.17-2-MANJARO #1 SMP PREEMPT_DYNAMIC. rustup as it comes from Manjaro packages. Nightly Rust (with rustup update), failing in 1.68.0-nightly, both 70898e522 2022-12-05 and 70898e522 2022-12-05.

rust on  vec_mvp_rustc_middle/src/ty/subst_internal_err:master [!⇡] via 🐍 v3.10.8 via 🦀 v1.68.0-nightly 
❯ cargo version
cargo 1.68.0-nightly (70898e522 2022-12-05)
rustc --version --verbose
rustc 1.68.0-nightly (c6fcdb690 2022-12-10)
binary: rustc
commit-hash: c6fcdb690609769a240fc8ab0de0ce68d5ea7dba
commit-date: 2022-12-10
host: x86_64-unknown-linux-gnu
release: 1.68.0-nightly
LLVM version: 15.0.6

config.toml

changelog-seen = 2

[llvm]
# download-ci-llvm = true
# assertions = false

[target.x86_64-unknown-linux-gnu]
llvm-config = "/usr/bin/llvm-config"

[target.x86_64-unknown-linux-musl]
llvm-config = "/usr/bin/llvm-config"

[build]
#extended = false
# Installs chosen set of extended tools if `extended = true`. By default builds
#tools = ["cargo", "rls", "clippy", "rustfmt", "analysis", "src"]

[rust]
channel = "nightly"
debug-logging = true
incremental = true 
debug = true
verbose-tests = true

TRIGGERING COMMIT

Outdated: The actual commit that triggers this error is coop-rs@27a545d on https://github.com/coop-rs/rust/tree/vec_mvp_rustc_middle/src/ty/subst_internal_err.

See a comment below for a newer, narrowed down, commit.

Note: the triggering commit is not compilable. Its parent is not either. It's based off https://github.com/rust-lang/rust/ 0master a few days ago. I'll rebase off current nightly, and if I can bisect it any closer, I update here.

ERROR OUTPUT - NON-VERBOSE

This is NON-verbose, because VERBOSE was over GitHub limit. I've put verbose one in an attached file (link below).

x clean
x check
extracting /share/pkehl/GIT/rust/build/cache/2022-11-01/rust-std-beta-x86_64-unknown-linux-gnu.tar.xz
extracting /share/pkehl/GIT/rust/build/cache/2022-11-01/rustc-beta-x86_64-unknown-linux-gnu.tar.xz
extracting /share/pkehl/GIT/rust/build/cache/2022-11-01/cargo-beta-x86_64-unknown-linux-gnu.tar.xz
Building rustbuild
   Compiling libc v0.2.137
   Compiling memchr v2.5.0
   Compiling proc-macro2 v1.0.46
   Compiling cfg-if v1.0.0
   Compiling unicode-ident v1.0.0
   Compiling version_check v0.9.4
   Compiling typenum v1.15.0
   Compiling generic-array v0.14.5
   Compiling syn v1.0.102
   Compiling quote v1.0.18
   Compiling serde_derive v1.0.137
   Compiling cc v1.0.73
   Compiling pkg-config v0.3.25
   Compiling serde v1.0.137
   Compiling io-lifetimes v1.0.1
   Compiling lazy_static v1.4.0
   Compiling log v0.4.17
   Compiling regex-automata v0.1.10
   Compiling lzma-sys v0.1.17
   Compiling bstr v0.2.17
   Compiling aho-corasick v0.7.18
   Compiling rustix v0.36.3
   Compiling crossbeam-utils v0.8.14
   Compiling regex-syntax v0.6.26
   Compiling crypto-common v0.1.3
   Compiling block-buffer v0.10.2
   Compiling bitflags v1.3.2
   Compiling serde_json v1.0.81
   Compiling linux-raw-sys v0.1.3
   Compiling fnv v1.0.7
   Compiling same-file v1.0.6
   Compiling once_cell v1.12.0
   Compiling thread_local v1.1.4
   Compiling walkdir v2.3.2
   Compiling digest v0.10.3
   Compiling regex v1.5.6
   Compiling globset v0.4.8
   Compiling filetime v0.2.16
   Compiling xattr v0.2.3
   Compiling unicode-width v0.1.9
   Compiling ryu v1.0.10
   Compiling bootstrap v0.0.0 (/share/pkehl/GIT/rust/src/bootstrap)
   Compiling itoa v1.0.2
   Compiling cpufeatures v0.2.5
   Compiling sha2 v0.10.2
   Compiling getopts v0.2.21
   Compiling tar v0.4.38
   Compiling ignore v0.4.18
   Compiling xz2 v0.1.6
   Compiling fd-lock v3.0.8
   Compiling opener v0.5.0
   Compiling cmake v0.1.48
   Compiling object v0.29.0
   Compiling hex v0.4.3
   Compiling toml v0.5.9
    Finished dev [unoptimized] target(s) in 37.15s
extracting /share/pkehl/GIT/rust/build/cache/2022-11-01/rustfmt-nightly-x86_64-unknown-linux-gnu.tar.xz to /share/pkehl/GIT/rust/build/x86_64-unknown-linux-gnu/stage0
Checking stage0 std artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
   Compiling compiler_builtins v0.1.84
    Checking core v0.0.0 (/share/pkehl/GIT/rust/library/core)
   Compiling libc v0.2.138
   Compiling cc v1.0.76
   Compiling memchr v2.5.0
   Compiling std v0.0.0 (/share/pkehl/GIT/rust/library/std)
   Compiling unwind v0.0.0 (/share/pkehl/GIT/rust/library/unwind)
    Checking rustc-std-workspace-core v1.99.0 (/share/pkehl/GIT/rust/library/rustc-std-workspace-core)
    Checking alloc v0.0.0 (/share/pkehl/GIT/rust/library/alloc)
    Checking cfg-if v1.0.0
    Checking adler v1.0.2
    Checking rustc-demangle v0.1.21
error: internal compiler error: compiler/rustc_middle/src/ty/subst.rs:768:9: const parameter `COOP_PREFERRED/#2` (Const { ty: bool, kind: Param(COOP_PREFERRED/#2) }/2) out of range when substituting substs=[_, alloc::Global]

thread 'rustc' panicked at 'Box<dyn Any>', /rustc/e080cc5a659fb760c0bc561b722a790dad35b5e1/compiler/rustc_errors/src/lib.rs:1519:9
stack backtrace:
   0:     0x7fd76220b340 - std::backtrace_rs::backtrace::libunwind::trace::h2df8645d586d9354
                               at /rustc/e080cc5a659fb760c0bc561b722a790dad35b5e1/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7fd76220b340 - std::backtrace_rs::backtrace::trace_unsynchronized::h8ccc7432adfc32a8
                               at /rustc/e080cc5a659fb760c0bc561b722a790dad35b5e1/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7fd76220b340 - std::sys_common::backtrace::_print_fmt::h6b5315b3e6c5b112
                               at /rustc/e080cc5a659fb760c0bc561b722a790dad35b5e1/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x7fd76220b340 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h1196a40d5ac35d56
                               at /rustc/e080cc5a659fb760c0bc561b722a790dad35b5e1/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7fd75e3c898e - core::fmt::write::hb5395aee3db34e90
                               at /rustc/e080cc5a659fb760c0bc561b722a790dad35b5e1/library/core/src/fmt/mod.rs:1209:17
   5:     0x7fd7621ff0f5 - std::io::Write::write_fmt::hf1b72fac8a3acb27
                               at /rustc/e080cc5a659fb760c0bc561b722a790dad35b5e1/library/std/src/io/mod.rs:1682:15
   6:     0x7fd76220b105 - std::sys_common::backtrace::_print::h805a3d8a840d4dd9
                               at /rustc/e080cc5a659fb760c0bc561b722a790dad35b5e1/library/std/src/sys_common/backtrace.rs:47:5
   7:     0x7fd76220b105 - std::sys_common::backtrace::print::h9dc5789e99bcd646
                               at /rustc/e080cc5a659fb760c0bc561b722a790dad35b5e1/library/std/src/sys_common/backtrace.rs:34:9
   8:     0x7fd76220d45f - std::panicking::default_hook::{{closure}}::h79c2a100d70e0a69
                               at /rustc/e080cc5a659fb760c0bc561b722a790dad35b5e1/library/std/src/panicking.rs:267:22
   9:     0x7fd76220d19a - std::panicking::default_hook::h9d54a6e2e183091b
                               at /rustc/e080cc5a659fb760c0bc561b722a790dad35b5e1/library/std/src/panicking.rs:286:9
  10:     0x7fd7614d3164 - rustc_driver[2731657a57c33a9f]::DEFAULT_HOOK::{closure#0}::{closure#0}
  11:     0x7fd76220dc49 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h22fa2a084fbafa5c
                               at /rustc/e080cc5a659fb760c0bc561b722a790dad35b5e1/library/alloc/src/boxed.rs:2001:9
  12:     0x7fd76220dc49 - std::panicking::rust_panic_with_hook::h66c09c3756b56830
                               at /rustc/e080cc5a659fb760c0bc561b722a790dad35b5e1/library/std/src/panicking.rs:692:13
  13:     0x7fd7618fbef1 - std[6a238fb43aa4c274]::panicking::begin_panic::<rustc_errors[8289f13c10dc8783]::ExplicitBug>::{closure#0}
  14:     0x7fd7618fba56 - std[6a238fb43aa4c274]::sys_common::backtrace::__rust_end_short_backtrace::<std[6a238fb43aa4c274]::panicking::begin_panic<rustc_errors[8289f13c10dc8783]::ExplicitBug>::{closure#0}, !>
  15:     0x7fd7619610a6 - std[6a238fb43aa4c274]::panicking::begin_panic::<rustc_errors[8289f13c10dc8783]::ExplicitBug>
  16:     0x7fd7618faa26 - std[6a238fb43aa4c274]::panic::panic_any::<rustc_errors[8289f13c10dc8783]::ExplicitBug>
  17:     0x7fd7618fa93d - <rustc_errors[8289f13c10dc8783]::HandlerInner>::bug::<&alloc[5aec1d928cb65a40]::string::String>
  18:     0x7fd7618fa3b0 - <rustc_errors[8289f13c10dc8783]::Handler>::bug::<&alloc[5aec1d928cb65a40]::string::String>
  19:     0x7fd7619c4bfd - rustc_middle[1e440ea759c2f365]::ty::context::tls::with_context_opt::<rustc_middle[1e440ea759c2f365]::ty::context::tls::with_opt<rustc_middle[1e440ea759c2f365]::util::bug::opt_span_bug_fmt<rustc_span[85bea1f81190796e]::span_encoding::Span>::{closure#0}, ()>::{closure#0}, ()>
  20:     0x7fd7619c6db6 - rustc_middle[1e440ea759c2f365]::util::bug::opt_span_bug_fmt::<rustc_span[85bea1f81190796e]::span_encoding::Span>
  21:     0x7fd75f7554e3 - rustc_middle[1e440ea759c2f365]::util::bug::bug_fmt
  22:     0x7fd7619ad8e2 - <rustc_middle[1e440ea759c2f365]::ty::subst::SubstFolder>::const_param_out_of_range
  23:     0x7fd75f532d8d - <rustc_middle[1e440ea759c2f365]::ty::subst::SubstFolder as rustc_middle[1e440ea759c2f365]::ty::fold::TypeFolder>::fold_const
  24:     0x7fd75f5345dc - <&rustc_middle[1e440ea759c2f365]::ty::list::List<rustc_middle[1e440ea759c2f365]::ty::subst::GenericArg> as rustc_middle[1e440ea759c2f365]::ty::fold::TypeFoldable>::try_fold_with::<rustc_middle[1e440ea759c2f365]::ty::subst::SubstFolder>
  25:     0x7fd75f534f1c - <rustc_middle[1e440ea759c2f365]::ty::consts::Const as rustc_middle[1e440ea759c2f365]::ty::fold::TypeSuperFoldable>::super_fold_with::<rustc_middle[1e440ea759c2f365]::ty::subst::SubstFolder>
  26:     0x7fd75f530966 - <rustc_middle[1e440ea759c2f365]::ty::subst::SubstFolder as rustc_middle[1e440ea759c2f365]::ty::fold::FallibleTypeFolder>::try_fold_ty
  27:     0x7fd7619ac16f - <rustc_middle[1e440ea759c2f365]::ty::subst::GenericArg as rustc_middle[1e440ea759c2f365]::ty::fold::TypeFoldable>::try_fold_with::<rustc_middle[1e440ea759c2f365]::ty::subst::SubstFolder>
  28:     0x7fd75f5c396c - <rustc_middle[1e440ea759c2f365]::ty::generics::GenericPredicates>::instantiate_into
  29:     0x7fd75f72e5fc - <rustc_trait_selection[429aeeaf97ad5f33]::traits::wf::WfPredicates>::nominal_obligations_inner
  30:     0x7fd75f72ae9b - <rustc_trait_selection[429aeeaf97ad5f33]::traits::wf::WfPredicates>::compute
  31:     0x7fd7603e34b3 - rustc_trait_selection[429aeeaf97ad5f33]::traits::wf::obligations
  32:     0x7fd75fff6b8a - <rustc_trait_selection[429aeeaf97ad5f33]::traits::select::SelectionContext>::evaluate_predicate_recursively
  33:     0x7fd75ff34a0e - <rustc_trait_selection[429aeeaf97ad5f33]::traits::select::SelectionContext>::evaluate_predicates_recursively::<alloc[5aec1d928cb65a40]::vec::Vec<rustc_infer[eb3d8a9fc270db4a]::traits::Obligation<rustc_middle[1e440ea759c2f365]::ty::Predicate>>>
  34:     0x7fd75fff5093 - <rustc_trait_selection[429aeeaf97ad5f33]::traits::select::SelectionContext>::evaluate_predicate_recursively
  35:     0x7fd760a0072c - <rustc_infer[eb3d8a9fc270db4a]::infer::InferCtxt>::probe::<core[6f75f940baff7b16]::result::Result<rustc_middle[1e440ea759c2f365]::traits::select::EvaluationResult, rustc_middle[1e440ea759c2f365]::traits::select::OverflowError>, <rustc_trait_selection[429aeeaf97ad5f33]::traits::select::SelectionContext>::evaluation_probe<<rustc_trait_selection[429aeeaf97ad5f33]::traits::select::SelectionContext>::evaluate_root_obligation::{closure#0}>::{closure#0}>
  36:     0x7fd760a18769 - <core[6f75f940baff7b16]::iter::adapters::copied::Copied<core[6f75f940baff7b16]::slice::iter::Iter<rustc_middle[1e440ea759c2f365]::ty::Predicate>> as core[6f75f940baff7b16]::iter::traits::iterator::Iterator>::try_fold::<(), &mut core[6f75f940baff7b16]::iter::adapters::map::map_try_fold<rustc_middle[1e440ea759c2f365]::ty::Predicate, rustc_middle[1e440ea759c2f365]::ty::Predicate, (), core[6f75f940baff7b16]::ops::control_flow::ControlFlow<rustc_infer[eb3d8a9fc270db4a]::traits::Obligation<rustc_middle[1e440ea759c2f365]::ty::Predicate>>, rustc_trait_selection[429aeeaf97ad5f33]::traits::coherence::implicit_negative::{closure#0}, core[6f75f940baff7b16]::iter::adapters::map::map_try_fold<rustc_middle[1e440ea759c2f365]::ty::Predicate, rustc_infer[eb3d8a9fc270db4a]::traits::Obligation<rustc_middle[1e440ea759c2f365]::ty::Predicate>, (), core[6f75f940baff7b16]::ops::control_flow::ControlFlow<rustc_infer[eb3d8a9fc270db4a]::traits::Obligation<rustc_middle[1e440ea759c2f365]::ty::Predicate>>, rustc_trait_selection[429aeeaf97ad5f33]::traits::coherence::implicit_negative::{closure#1}, core[6f75f940baff7b16]::iter::traits::iterator::Iterator::find::check<rustc_infer[eb3d8a9fc270db4a]::traits::Obligation<rustc_middle[1e440ea759c2f365]::ty::Predicate>, &mut rustc_trait_selection[429aeeaf97ad5f33]::traits::coherence::implicit_negative::{closure#2}>::{closure#0}>::{closure#0}>::{closure#0}, core[6f75f940baff7b16]::ops::control_flow::ControlFlow<rustc_infer[eb3d8a9fc270db4a]::traits::Obligation<rustc_middle[1e440ea759c2f365]::ty::Predicate>>>
  37:     0x7fd760a18503 - <core[6f75f940baff7b16]::iter::adapters::chain::Chain<core[6f75f940baff7b16]::iter::adapters::copied::Copied<core[6f75f940baff7b16]::slice::iter::Iter<rustc_middle[1e440ea759c2f365]::ty::Predicate>>, alloc[5aec1d928cb65a40]::vec::into_iter::IntoIter<rustc_middle[1e440ea759c2f365]::ty::Predicate>> as core[6f75f940baff7b16]::iter::traits::iterator::Iterator>::try_fold::<(), core[6f75f940baff7b16]::iter::adapters::map::map_try_fold<rustc_middle[1e440ea759c2f365]::ty::Predicate, rustc_middle[1e440ea759c2f365]::ty::Predicate, (), core[6f75f940baff7b16]::ops::control_flow::ControlFlow<rustc_infer[eb3d8a9fc270db4a]::traits::Obligation<rustc_middle[1e440ea759c2f365]::ty::Predicate>>, rustc_trait_selection[429aeeaf97ad5f33]::traits::coherence::implicit_negative::{closure#0}, core[6f75f940baff7b16]::iter::adapters::map::map_try_fold<rustc_middle[1e440ea759c2f365]::ty::Predicate, rustc_infer[eb3d8a9fc270db4a]::traits::Obligation<rustc_middle[1e440ea759c2f365]::ty::Predicate>, (), core[6f75f940baff7b16]::ops::control_flow::ControlFlow<rustc_infer[eb3d8a9fc270db4a]::traits::Obligation<rustc_middle[1e440ea759c2f365]::ty::Predicate>>, rustc_trait_selection[429aeeaf97ad5f33]::traits::coherence::implicit_negative::{closure#1}, core[6f75f940baff7b16]::iter::traits::iterator::Iterator::find::check<rustc_infer[eb3d8a9fc270db4a]::traits::Obligation<rustc_middle[1e440ea759c2f365]::ty::Predicate>, &mut rustc_trait_selection[429aeeaf97ad5f33]::traits::coherence::implicit_negative::{closure#2}>::{closure#0}>::{closure#0}>::{closure#0}, core[6f75f940baff7b16]::ops::control_flow::ControlFlow<rustc_infer[eb3d8a9fc270db4a]::traits::Obligation<rustc_middle[1e440ea759c2f365]::ty::Predicate>>>
  38:     0x7fd76085c467 - rustc_trait_selection[429aeeaf97ad5f33]::traits::coherence::overlap_within_probe
  39:     0x7fd76085b8d3 - <rustc_infer[eb3d8a9fc270db4a]::infer::InferCtxt>::probe_maybe_skip_leak_check::<core[6f75f940baff7b16]::option::Option<rustc_trait_selection[429aeeaf97ad5f33]::traits::coherence::OverlapResult>, rustc_trait_selection[429aeeaf97ad5f33]::traits::coherence::overlap::{closure#0}>
  40:     0x7fd760858b8c - <rustc_middle[1e440ea759c2f365]::traits::specialization_graph::Children as rustc_trait_selection[429aeeaf97ad5f33]::traits::specialize::specialization_graph::ChildrenExt>::insert
  41:     0x7fd760855cd3 - <rustc_middle[1e440ea759c2f365]::traits::specialization_graph::Graph as rustc_trait_selection[429aeeaf97ad5f33]::traits::specialize::specialization_graph::GraphExt>::insert
  42:     0x7fd760853e3d - rustc_trait_selection[429aeeaf97ad5f33]::traits::specialize::specialization_graph_provider
  43:     0x7fd760813034 - <rustc_query_system[9e10ef674197eb88]::dep_graph::graph::DepGraph<rustc_middle[1e440ea759c2f365]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[1e440ea759c2f365]::ty::context::TyCtxt, rustc_span[85bea1f81190796e]::def_id::DefId, rustc_middle[1e440ea759c2f365]::traits::specialization_graph::Graph>
  44:     0x7fd760810a09 - rustc_query_system[9e10ef674197eb88]::query::plumbing::try_execute_query::<rustc_query_impl[94dddaa624b13a2e]::plumbing::QueryCtxt, rustc_query_system[9e10ef674197eb88]::query::caches::ArenaCache<rustc_span[85bea1f81190796e]::def_id::DefId, rustc_middle[1e440ea759c2f365]::traits::specialization_graph::Graph>>
  45:     0x7fd760779e5e - rustc_query_system[9e10ef674197eb88]::query::plumbing::get_query::<rustc_query_impl[94dddaa624b13a2e]::queries::specialization_graph_of, rustc_query_impl[94dddaa624b13a2e]::plumbing::QueryCtxt>
  46:     0x7fd760b4c93b - rustc_hir_analysis[9182be28d676711c]::coherence::coherent_trait
  47:     0x7fd75fe98bbb - <rustc_query_system[9e10ef674197eb88]::dep_graph::graph::DepGraph<rustc_middle[1e440ea759c2f365]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[1e440ea759c2f365]::ty::context::TyCtxt, rustc_span[85bea1f81190796e]::def_id::DefId, ()>
  48:     0x7fd75fe93379 - rustc_query_system[9e10ef674197eb88]::query::plumbing::try_execute_query::<rustc_query_impl[94dddaa624b13a2e]::plumbing::QueryCtxt, rustc_query_system[9e10ef674197eb88]::query::caches::DefaultCache<rustc_span[85bea1f81190796e]::def_id::DefId, ()>>
  49:     0x7fd76083dc65 - rustc_query_system[9e10ef674197eb88]::query::plumbing::get_query::<rustc_query_impl[94dddaa624b13a2e]::queries::coherent_trait, rustc_query_impl[94dddaa624b13a2e]::plumbing::QueryCtxt>
  50:     0x7fd75f903fa2 - <rustc_session[638750f383577479]::session::Session>::track_errors::<rustc_hir_analysis[9182be28d676711c]::check_crate::{closure#3}, ()>
  51:     0x7fd75f900003 - rustc_hir_analysis[9182be28d676711c]::check_crate
  52:     0x7fd75f8ffcdb - rustc_interface[e10a04643064e0c3]::passes::analysis
  53:     0x7fd760d3cbbe - <rustc_query_system[9e10ef674197eb88]::dep_graph::graph::DepGraph<rustc_middle[1e440ea759c2f365]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[1e440ea759c2f365]::ty::context::TyCtxt, (), core[6f75f940baff7b16]::result::Result<(), rustc_errors[8289f13c10dc8783]::ErrorGuaranteed>>
  54:     0x7fd760d3bf34 - rustc_query_system[9e10ef674197eb88]::query::plumbing::try_execute_query::<rustc_query_impl[94dddaa624b13a2e]::plumbing::QueryCtxt, rustc_query_system[9e10ef674197eb88]::query::caches::DefaultCache<(), core[6f75f940baff7b16]::result::Result<(), rustc_errors[8289f13c10dc8783]::ErrorGuaranteed>>>
  55:     0x7fd760d3b9b7 - rustc_query_system[9e10ef674197eb88]::query::plumbing::get_query::<rustc_query_impl[94dddaa624b13a2e]::queries::analysis, rustc_query_impl[94dddaa624b13a2e]::plumbing::QueryCtxt>
  56:     0x7fd76087e6fd - <rustc_interface[e10a04643064e0c3]::passes::QueryContext>::enter::<rustc_driver[2731657a57c33a9f]::run_compiler::{closure#1}::{closure#2}::{closure#3}, core[6f75f940baff7b16]::result::Result<(), rustc_errors[8289f13c10dc8783]::ErrorGuaranteed>>
  57:     0x7fd76087abaf - <rustc_interface[e10a04643064e0c3]::interface::Compiler>::enter::<rustc_driver[2731657a57c33a9f]::run_compiler::{closure#1}::{closure#2}, core[6f75f940baff7b16]::result::Result<core[6f75f940baff7b16]::option::Option<rustc_interface[e10a04643064e0c3]::queries::Linker>, rustc_errors[8289f13c10dc8783]::ErrorGuaranteed>>
  58:     0x7fd7608726f2 - rustc_span[85bea1f81190796e]::with_source_map::<core[6f75f940baff7b16]::result::Result<(), rustc_errors[8289f13c10dc8783]::ErrorGuaranteed>, rustc_interface[e10a04643064e0c3]::interface::run_compiler<core[6f75f940baff7b16]::result::Result<(), rustc_errors[8289f13c10dc8783]::ErrorGuaranteed>, rustc_driver[2731657a57c33a9f]::run_compiler::{closure#1}>::{closure#0}::{closure#1}>
  59:     0x7fd7608721e9 - <scoped_tls[df6a59750083ca9d]::ScopedKey<rustc_span[85bea1f81190796e]::SessionGlobals>>::set::<rustc_interface[e10a04643064e0c3]::interface::run_compiler<core[6f75f940baff7b16]::result::Result<(), rustc_errors[8289f13c10dc8783]::ErrorGuaranteed>, rustc_driver[2731657a57c33a9f]::run_compiler::{closure#1}>::{closure#0}, core[6f75f940baff7b16]::result::Result<(), rustc_errors[8289f13c10dc8783]::ErrorGuaranteed>>
  60:     0x7fd7608717f8 - std[6a238fb43aa4c274]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[e10a04643064e0c3]::util::run_in_thread_pool_with_globals<rustc_interface[e10a04643064e0c3]::interface::run_compiler<core[6f75f940baff7b16]::result::Result<(), rustc_errors[8289f13c10dc8783]::ErrorGuaranteed>, rustc_driver[2731657a57c33a9f]::run_compiler::{closure#1}>::{closure#0}, core[6f75f940baff7b16]::result::Result<(), rustc_errors[8289f13c10dc8783]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[6f75f940baff7b16]::result::Result<(), rustc_errors[8289f13c10dc8783]::ErrorGuaranteed>>
  61:     0x7fd76087151c - <<std[6a238fb43aa4c274]::thread::Builder>::spawn_unchecked_<rustc_interface[e10a04643064e0c3]::util::run_in_thread_pool_with_globals<rustc_interface[e10a04643064e0c3]::interface::run_compiler<core[6f75f940baff7b16]::result::Result<(), rustc_errors[8289f13c10dc8783]::ErrorGuaranteed>, rustc_driver[2731657a57c33a9f]::run_compiler::{closure#1}>::{closure#0}, core[6f75f940baff7b16]::result::Result<(), rustc_errors[8289f13c10dc8783]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[6f75f940baff7b16]::result::Result<(), rustc_errors[8289f13c10dc8783]::ErrorGuaranteed>>::{closure#1} as core[6f75f940baff7b16]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  62:     0x7fd762214bc3 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h23aa6e7db304ed51
                               at /rustc/e080cc5a659fb760c0bc561b722a790dad35b5e1/library/alloc/src/boxed.rs:1987:9
  63:     0x7fd762214bc3 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h0482f1835c06f38d
                               at /rustc/e080cc5a659fb760c0bc561b722a790dad35b5e1/library/alloc/src/boxed.rs:1987:9
  64:     0x7fd762214bc3 - std::sys::unix::thread::Thread::new::thread_start::h5213f0bce91e8f3e
                               at /rustc/e080cc5a659fb760c0bc561b722a790dad35b5e1/library/std/src/sys/unix/thread.rs:108:17
  65:     0x7fd75e0dc8fd - <unknown>
  66:     0x7fd75e15ea60 - <unknown>
  67:                0x0 - <unknown>

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.66.0-beta.1 (e080cc5a6 2022-11-01) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type lib -C opt-level=3 -C embed-bitcode=no -C debuginfo=1 -C debug-assertions=on -Z unstable-options -C incremental=[REDACTED] -C symbol-mangling-version=legacy -Z unstable-options -Z unstable-options -Z macro-backtrace -C link-args=-Wl,-z,origin -C link-args=-Wl,-rpath,$ORIGIN/../lib -C split-debuginfo=off -C prefer-dynamic -C llvm-args=-import-instr-limit=10 -Z crate-attr=doc(html_root_url="https://doc.rust-lang.org/nightly/") -Z binary-dep-depinfo -Z force-unstable-if-unmarked

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

query stack during panic:
#0 [specialization_graph_of] building specialization graph of trait `collections::vec_deque::spec_extend::SpecExtend`
#1 [coherent_trait] coherence checking all impls of trait `collections::vec_deque::spec_extend::SpecExtend`
#2 [analysis] running analysis passes on this crate
end of query stack
error: could not compile `alloc`
Build completed unsuccessfully in 0:01:12

ERROR OUTPUT - VERBOSE

Output from x check --verbose based on the original triggering commit.

@peter-lyons-kehl peter-lyons-kehl added C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Dec 11, 2022
@peter-lyons-kehl
Copy link
Contributor Author

Update: I've rebased off 657eefe to coop-rs@a2b34ee. It still fails to build.

@peter-lyons-kehl
Copy link
Contributor Author

peter-lyons-kehl commented Dec 12, 2022

@peter-lyons-kehl
Copy link
Contributor Author

Narrowed down more - the smallest change that triggers the error: https://github.com/coop-rs/rust/tree/vec_mvp_rustc_middle/src/ty/subst_internal_err_narrow_down_4 commit coop-rs@c094458

@peter-lyons-kehl
Copy link
Contributor Author

Is this low priority, but fairly easy to debug/fix? If so, please suggest which modules/structs/functions are worth investigating.

@peter-lyons-kehl
Copy link
Contributor Author

peter-lyons-kehl commented Dec 13, 2022

Narrowed down in another way:
https://github.com/coop-rs/rust/tree/vec_mvp_rustc_middle/src/ty/subst_internal_err_narrow_down_5

  • 3847e14 makes nightly panic (mistakes in generics code), but
  • 6264c24 makes nightly end gracefully (compile fails, but no panic).

@peter-lyons-kehl
Copy link
Contributor Author

peter-lyons-kehl commented Dec 13, 2022

But: https://github.com/coop-rs/rust/tree/vec_mvp_rustc_middle/src/ty/subst_internal_err_narrow_down_6 where I fixed (my) generics errors: coop-rs@143063b makes the compiler panic again!

@peter-lyons-kehl peter-lyons-kehl changed the title internal error in compiler/rustc_middle/src/ty/subst.rs ICE in compiler/rustc_middle/src/ty/subst.rs Dec 13, 2022
@peter-lyons-kehl
Copy link
Contributor Author

Reproducible in rust-lang/rust CI: #105673

@peter-lyons-kehl peter-lyons-kehl changed the title ICE in compiler/rustc_middle/src/ty/subst.rs ICE const parameter... out of range when substituting substs=[_, alloc::Global] Dec 13, 2022
@peter-lyons-kehl
Copy link
Contributor Author

Potentially related to #94846.

@compiler-errors
Copy link
Member

I've minimized it as far as it'll minimize in #106473, so I'm gonna close this in favor of that one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

2 participants