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: tcx: index out of bounds #129075

Open
matthiaskrgr opened this issue Aug 14, 2024 · 2 comments · May be fixed by #133365
Open

ICE: tcx: index out of bounds #129075

matthiaskrgr opened this issue Aug 14, 2024 · 2 comments · May be fixed by #133365
Labels
A-mir-opt Area: MIR optimizations A-mir-opt-inlining Area: MIR inlining C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ S-bug-has-test Status: This bug is tracked inside the repo by a `known-bug` test. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@matthiaskrgr
Copy link
Member

auto-reduced (treereduce-rust):

struct Foo<T>([T; 2]);

impl<T: Default + Copy> Default for Foo<T> {
    fn default(&mut self) -> Self {
        Foo([Default::default(); 2])
    }
}

fn field_array() {
    let a: i32;
    let b;
    Foo([a, b]) = Default::default();
}
original code

original:

#![allow(unused_variables)]

use std::array::TryFromSliceError;
use std::convert::TryInto;

struct Zeroes;
impl Into<[usize; 2]> for Zeroes {
    fn into(self) -> [usize; 2] {
        [0; 2]
    }
}
impl Into<[usize; 3]> for Zeroes {
    fn into(self) -> [usize; 3] {
        [0; 3]
    }
}
impl Into<[Option<Box<u8>>; 48]> for Zeroes {
    fn into(self) -> [usize; 4] {
        [0; 4]
    }
}

fn zeroes_into() {
    let [a, b, c] = Zeroes.into();
    let [d, e, f]: [_; 3] = Zeroes.into();
}

fn array_try_from(x: &[usize]) -> Result<usize, TryFromSliceError> {
    let [a, b] = d.succ().isoweekdate().1()?;
    Ok(a + b)
}

fn destructuring_assignment() {
    let a: i32;
    let b;
    [a, b] = Default::default();
}

fn test_nested_array() {
    let a: [_; 3];
    let b;
    //~^ ERROR type annotations needed
    [a, b] = Default::default();
}

fn test_nested_array_type_hint() {
    let a: [_; 3];
    let b;
    [a, b] = Default::default();
    let _: i32 = b[1];
}

fn test_working_nested_array() {
    let a: i32;
    [[a, _, _], _, _] = Default::default();
}

struct Foo<T>([T; 2]);

impl<T: Default + Copy> Default for Foo<T> {
    fn default(&mut self, (_,): (T,)) -> Self {
        Foo([Default::default(); 2])
    }
}

fn field_array() {
    let a: i32;
    let b;
    Foo([a, b]) = Default::default();
}

fn main() {}

Version information

rustc 1.82.0-nightly (e5b3e68ab 2024-08-13)
binary: rustc
commit-hash: e5b3e68abf170556b9d56c6f9028318e53c9f06b
commit-date: 2024-08-13
host: x86_64-unknown-linux-gnu
release: 1.82.0-nightly
LLVM version: 19.1.0

Command:
/home/matthias/.rustup/toolchains/master/bin/rustc -Zvalidate-mir -Zinline-mir=yes

Program output

error[E0601]: `main` function not found in crate `mvce`
  --> /tmp/icemaker_global_tempdir.ufzSPaPZx9Up/rustc_testrunner_tmpdir_reporting.doFpl6Nkk2VR/mvce.rs:13:2
   |
13 | }
   |  ^ consider adding a `main` function to `/tmp/icemaker_global_tempdir.ufzSPaPZx9Up/rustc_testrunner_tmpdir_reporting.doFpl6Nkk2VR/mvce.rs`

error[E0185]: method `default` has a `&mut self` declaration in the impl, but not in the trait
 --> /tmp/icemaker_global_tempdir.ufzSPaPZx9Up/rustc_testrunner_tmpdir_reporting.doFpl6Nkk2VR/mvce.rs:4:5
  |
4 |     fn default(&mut self) -> Self {
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `&mut self` used in impl
  |
  = note: `default` from trait: `fn() -> Self`

warning: variable `a` is assigned to, but never used
  --> /tmp/icemaker_global_tempdir.ufzSPaPZx9Up/rustc_testrunner_tmpdir_reporting.doFpl6Nkk2VR/mvce.rs:10:9
   |
10 |     let a: i32;
   |         ^
   |
   = note: consider using `_a` instead
   = note: `#[warn(unused_variables)]` on by default

warning: variable `b` is assigned to, but never used
  --> /tmp/icemaker_global_tempdir.ufzSPaPZx9Up/rustc_testrunner_tmpdir_reporting.doFpl6Nkk2VR/mvce.rs:11:9
   |
11 |     let b;
   |         ^
   |
   = note: consider using `_b` instead

warning: value assigned to `a` is never read
  --> /tmp/icemaker_global_tempdir.ufzSPaPZx9Up/rustc_testrunner_tmpdir_reporting.doFpl6Nkk2VR/mvce.rs:12:10
   |
12 |     Foo([a, b]) = Default::default();
   |          ^
   |
   = help: maybe it is overwritten before being read?
   = note: `#[warn(unused_assignments)]` on by default

warning: value assigned to `b` is never read
  --> /tmp/icemaker_global_tempdir.ufzSPaPZx9Up/rustc_testrunner_tmpdir_reporting.doFpl6Nkk2VR/mvce.rs:12:13
   |
12 |     Foo([a, b]) = Default::default();
   |             ^
   |
   = help: maybe it is overwritten before being read?

thread 'rustc' panicked at /rustc/e5b3e68abf170556b9d56c6f9028318e53c9f06b/compiler/rustc_middle/src/mir/tcx.rs:131:61:
index out of bounds: the len is 11 but the index is 11
stack backtrace:
   0:     0x71a82a9be6ad - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::hd8cddadc2f1356ba
   1:     0x71a82b2049ef - core::fmt::write::hf4a4be5c7aa55e78
   2:     0x71a82c1c5511 - std::io::Write::write_fmt::h937572d76c9c7a9b
   3:     0x71a82a9c0d8b - std::panicking::default_hook::{{closure}}::h663ce340916a5919
   4:     0x71a82a9c09fe - std::panicking::default_hook::h5cb270171c609139
   5:     0x71a829b4b6c9 - std[c898dee7a900a719]::panicking::update_hook::<alloc[f79bb38400b26b08]::boxed::Box<rustc_driver_impl[7bc6674bbf855457]::install_ice_hook::{closure#0}>>::{closure#0}
   6:     0x71a82a9c16a7 - std::panicking::rust_panic_with_hook::h527dcb0b253a1e21
   7:     0x71a82a9c1367 - std::panicking::begin_panic_handler::{{closure}}::hbc0a646a011dd19f
   8:     0x71a82a9beb69 - std::sys::backtrace::__rust_end_short_backtrace::h44802a1bb26a785a
   9:     0x71a82a9c1034 - rust_begin_unwind
  10:     0x71a827f50563 - core::panicking::panic_fmt::hb546fe36be3a0f24
  11:     0x71a828efc287 - core::panicking::panic_bounds_check::h90b5d213a1bed1e4
  12:     0x71a82bb52baa - <rustc_mir_transform[9616e0e93931520b]::inline::Inliner>::try_inlining
  13:     0x71a82bb4fc89 - <rustc_mir_transform[9616e0e93931520b]::inline::Inliner>::process_blocks
  14:     0x71a82bb4fd09 - <rustc_mir_transform[9616e0e93931520b]::inline::Inliner>::process_blocks
  15:     0x71a82bb4f126 - <rustc_mir_transform[9616e0e93931520b]::inline::Inline as rustc_middle[2e745f839ecdcb12]::mir::MirPass>::run_pass
  16:     0x71a82b201cd1 - rustc_mir_transform[9616e0e93931520b]::pass_manager::run_passes_inner
  17:     0x71a82b7a1df2 - rustc_mir_transform[9616e0e93931520b]::optimized_mir
  18:     0x71a82c143ddb - rustc_query_impl[52474172086763ba]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[52474172086763ba]::query_impl::optimized_mir::dynamic_query::{closure#2}::{closure#0}, rustc_middle[2e745f839ecdcb12]::query::erase::Erased<[u8; 8usize]>>
  19:     0x71a82b228434 - rustc_query_system[1f2263bc77e8d28d]::query::plumbing::try_execute_query::<rustc_query_impl[52474172086763ba]::DynamicConfig<rustc_query_system[1f2263bc77e8d28d]::query::caches::DefIdCache<rustc_middle[2e745f839ecdcb12]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[52474172086763ba]::plumbing::QueryCtxt, false>
  20:     0x71a82b2279df - rustc_query_impl[52474172086763ba]::query_impl::optimized_mir::get_query_non_incr::__rust_end_short_backtrace
  21:     0x71a827f13204 - <rustc_middle[2e745f839ecdcb12]::ty::context::TyCtxt>::instance_mir
  22:     0x71a82b9af306 - rustc_interface[922598e417aca69f]::passes::run_required_analyses
  23:     0x71a82bd3611e - rustc_interface[922598e417aca69f]::passes::analysis
  24:     0x71a82bd360f1 - rustc_query_impl[52474172086763ba]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[52474172086763ba]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[2e745f839ecdcb12]::query::erase::Erased<[u8; 1usize]>>
  25:     0x71a82c18efae - rustc_query_system[1f2263bc77e8d28d]::query::plumbing::try_execute_query::<rustc_query_impl[52474172086763ba]::DynamicConfig<rustc_query_system[1f2263bc77e8d28d]::query::caches::SingleCache<rustc_middle[2e745f839ecdcb12]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[52474172086763ba]::plumbing::QueryCtxt, false>
  26:     0x71a82c18ed0f - rustc_query_impl[52474172086763ba]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
  27:     0x71a82bfced29 - rustc_interface[922598e417aca69f]::interface::run_compiler::<core[57139b9ad86af3c3]::result::Result<(), rustc_span[6e02c34e35948369]::ErrorGuaranteed>, rustc_driver_impl[7bc6674bbf855457]::run_compiler::{closure#0}>::{closure#1}
  28:     0x71a82bfb6690 - std[c898dee7a900a719]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[922598e417aca69f]::util::run_in_thread_with_globals<rustc_interface[922598e417aca69f]::util::run_in_thread_pool_with_globals<rustc_interface[922598e417aca69f]::interface::run_compiler<core[57139b9ad86af3c3]::result::Result<(), rustc_span[6e02c34e35948369]::ErrorGuaranteed>, rustc_driver_impl[7bc6674bbf855457]::run_compiler::{closure#0}>::{closure#1}, core[57139b9ad86af3c3]::result::Result<(), rustc_span[6e02c34e35948369]::ErrorGuaranteed>>::{closure#0}, core[57139b9ad86af3c3]::result::Result<(), rustc_span[6e02c34e35948369]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[57139b9ad86af3c3]::result::Result<(), rustc_span[6e02c34e35948369]::ErrorGuaranteed>>
  29:     0x71a82bfb6cfa - <<std[c898dee7a900a719]::thread::Builder>::spawn_unchecked_<rustc_interface[922598e417aca69f]::util::run_in_thread_with_globals<rustc_interface[922598e417aca69f]::util::run_in_thread_pool_with_globals<rustc_interface[922598e417aca69f]::interface::run_compiler<core[57139b9ad86af3c3]::result::Result<(), rustc_span[6e02c34e35948369]::ErrorGuaranteed>, rustc_driver_impl[7bc6674bbf855457]::run_compiler::{closure#0}>::{closure#1}, core[57139b9ad86af3c3]::result::Result<(), rustc_span[6e02c34e35948369]::ErrorGuaranteed>>::{closure#0}, core[57139b9ad86af3c3]::result::Result<(), rustc_span[6e02c34e35948369]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[57139b9ad86af3c3]::result::Result<(), rustc_span[6e02c34e35948369]::ErrorGuaranteed>>::{closure#1} as core[57139b9ad86af3c3]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  30:     0x71a82bfb706b - std::sys::pal::unix::thread::Thread::new::thread_start::h2b4f313cc68cf720
  31:     0x71a82d72139d - <unknown>
  32:     0x71a82d7a649c - <unknown>
  33:                0x0 - <unknown>

error: 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: please make sure that you have updated to the latest nightly

note: rustc 1.82.0-nightly (e5b3e68ab 2024-08-13) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z validate-mir -Z inline-mir=yes -Z dump-mir-dir=dir

query stack during panic:
#0 [optimized_mir] optimizing MIR for `field_array`
#1 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to 2 previous errors; 4 warnings emitted

Some errors have detailed explanations: E0185, E0601.
For more information about an error, try `rustc --explain E0185`.

@matthiaskrgr matthiaskrgr added 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. C-bug Category: This is a bug. labels Aug 14, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Aug 14, 2024
@matthiaskrgr matthiaskrgr added A-mir-opt Area: MIR optimizations A-mir-opt-inlining Area: MIR inlining labels Aug 14, 2024
@matthiaskrgr
Copy link
Member Author

#128612 :/

@matthiaskrgr matthiaskrgr added the S-bug-has-test Status: This bug is tracked inside the repo by a `known-bug` test. label Aug 16, 2024
@saethlin saethlin removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Aug 19, 2024
@matthiaskrgr matthiaskrgr changed the title ICE: index out of bounds ICE: tcx: index out of bounds Sep 29, 2024
@matthiaskrgr
Copy link
Member Author

auto-reduced (treereduce-rust):

//@compile-flags: -Zvalidate-mir -Cdebuginfo=2 -Copt-level=3
trait Meow {
    fn poll(&self) {}
}
impl<T> Meow for T {
    fn poll(&self, _ctx: &mut core::task::Context<'_>) {}
}
fn main() {
    ().poll();
}

original:

//@ revisions: e2021 e2024
//@[e2021] edition: 2021
//@[e2024] edition: 2024
//@[e2024] compile-flags: -Zunstable-options
//@ check-pass

#![deny(rust_2024_prelude_collisions)]
trait Meow {
    fn poll(&self) {}
}
impl<T> Meow for T {
    fn poll(&self, _ctx: &mut core::task::Context<'_>) {}
}
fn main() {
    // As the self type here is not `Pin<&mut _>`, the lint does not fire.
    ().poll();
}

Version information

rustc 1.84.0-nightly (4d215e242 2024-11-06)
binary: rustc
commit-hash: 4d215e2426d52ca8d1af166d5f6b5e172afbff67
commit-date: 2024-11-06
host: x86_64-unknown-linux-gnu
release: 1.84.0-nightly
LLVM version: 19.1.3

Command:
/home/matthias/.rustup/toolchains/master/bin/rustc -Zvalidate-mir -Cdebuginfo=2 -Copt-level=3

Program output

error[E0050]: method `poll` has 2 parameters but the declaration in trait `Meow::poll` has 1
 --> /tmp/icemaker_global_tempdir.KRNINZP9vLon/rustc_testrunner_tmpdir_reporting.cSioY6bOaXzL/mvce.rs:5:13
  |
2 |     fn poll(&self) {}
  |             ----- trait requires 1 parameter
...
5 |     fn poll(&self, _ctx: &mut core::task::Context<'_>) {}
  |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected 1 parameter, found 2

thread 'rustc' panicked at /rustc/4d215e2426d52ca8d1af166d5f6b5e172afbff67/compiler/rustc_middle/src/mir/tcx.rs:132:61:
index out of bounds: the len is 5 but the index is 5
stack backtrace:
   0:     0x75a3aa85231a - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::h2a62aef6790d7b15
   1:     0x75a3ab0043e6 - core::fmt::write::he06f597458bb9ff6
   2:     0x75a3ac3c0411 - std::io::Write::write_fmt::hd5df7cc41b85167f
   3:     0x75a3aa852172 - std::sys::backtrace::BacktraceLock::print::he947fb17670d9eba
   4:     0x75a3aa854676 - std::panicking::default_hook::{{closure}}::haee5081958228d5d
   5:     0x75a3aa8544c0 - std::panicking::default_hook::h9d9b924f5ca1a141
   6:     0x75a3a98d1e09 - std[fb7db6bd1f14c888]::panicking::update_hook::<alloc[42726f5bb67657ba]::boxed::Box<rustc_driver_impl[ececb8dd003d922]::install_ice_hook::{closure#0}>>::{closure#0}
   7:     0x75a3aa854d88 - std::panicking::rust_panic_with_hook::hc489d1df4ff5f803
   8:     0x75a3aa854b5a - std::panicking::begin_panic_handler::{{closure}}::h26c53975a9f23f9b
   9:     0x75a3aa8527c9 - std::sys::backtrace::__rust_end_short_backtrace::h7f0b59d4cc0ea272
  10:     0x75a3aa85481c - rust_begin_unwind
  11:     0x75a3a72c9fe0 - core::panicking::panic_fmt::h16669a85d00adb4b
  12:     0x75a3a8fce7bb - core::panicking::panic_bounds_check::h56c3e34a596e7297
  13:     0x75a3a7ccbc8f - rustc_mir_transform[ae42b71eeaa5b7a0]::validate::validate_types
  14:     0x75a3ac012797 - <rustc_mir_transform[ae42b71eeaa5b7a0]::validate::Validator as rustc_mir_transform[ae42b71eeaa5b7a0]::pass_manager::MirPass>::run_pass
  15:     0x75a3a91c174f - rustc_mir_transform[ae42b71eeaa5b7a0]::pass_manager::validate_body
  16:     0x75a3ab006205 - rustc_mir_transform[ae42b71eeaa5b7a0]::pass_manager::run_passes_inner
  17:     0x75a3ab3a724a - rustc_mir_transform[ae42b71eeaa5b7a0]::optimized_mir
  18:     0x75a3ab3a5b1d - rustc_query_impl[3c80e39ee43abf73]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[3c80e39ee43abf73]::query_impl::optimized_mir::dynamic_query::{closure#2}::{closure#0}, rustc_middle[3d70962cb5f21973]::query::erase::Erased<[u8; 8usize]>>
  19:     0x75a3ab02216a - rustc_query_system[ddfcc40078111d3b]::query::plumbing::try_execute_query::<rustc_query_impl[3c80e39ee43abf73]::DynamicConfig<rustc_query_system[ddfcc40078111d3b]::query::caches::DefIdCache<rustc_middle[3d70962cb5f21973]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[3c80e39ee43abf73]::plumbing::QueryCtxt, false>
  20:     0x75a3ab02171f - rustc_query_impl[3c80e39ee43abf73]::query_impl::optimized_mir::get_query_non_incr::__rust_end_short_backtrace
  21:     0x75a3a83abddf - <rustc_middle[3d70962cb5f21973]::ty::context::TyCtxt>::instance_mir
  22:     0x75a3ab836f24 - rustc_interface[bead3511298ef818]::passes::run_required_analyses
  23:     0x75a3abe06e5e - rustc_interface[bead3511298ef818]::passes::analysis
  24:     0x75a3abe06e2f - rustc_query_impl[3c80e39ee43abf73]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[3c80e39ee43abf73]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[3d70962cb5f21973]::query::erase::Erased<[u8; 1usize]>>
  25:     0x75a3abf7876e - rustc_query_system[ddfcc40078111d3b]::query::plumbing::try_execute_query::<rustc_query_impl[3c80e39ee43abf73]::DynamicConfig<rustc_query_system[ddfcc40078111d3b]::query::caches::SingleCache<rustc_middle[3d70962cb5f21973]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[3c80e39ee43abf73]::plumbing::QueryCtxt, false>
  26:     0x75a3abf7844e - rustc_query_impl[3c80e39ee43abf73]::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
  27:     0x75a3abe89cba - rustc_interface[bead3511298ef818]::interface::run_compiler::<core[8f4b167961bfb5e8]::result::Result<(), rustc_span[7b0df660ef271586]::ErrorGuaranteed>, rustc_driver_impl[ececb8dd003d922]::run_compiler::{closure#0}>::{closure#1}
  28:     0x75a3abf296d0 - std[fb7db6bd1f14c888]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[bead3511298ef818]::util::run_in_thread_with_globals<rustc_interface[bead3511298ef818]::util::run_in_thread_pool_with_globals<rustc_interface[bead3511298ef818]::interface::run_compiler<core[8f4b167961bfb5e8]::result::Result<(), rustc_span[7b0df660ef271586]::ErrorGuaranteed>, rustc_driver_impl[ececb8dd003d922]::run_compiler::{closure#0}>::{closure#1}, core[8f4b167961bfb5e8]::result::Result<(), rustc_span[7b0df660ef271586]::ErrorGuaranteed>>::{closure#0}, core[8f4b167961bfb5e8]::result::Result<(), rustc_span[7b0df660ef271586]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[8f4b167961bfb5e8]::result::Result<(), rustc_span[7b0df660ef271586]::ErrorGuaranteed>>
  29:     0x75a3abf29aeb - <<std[fb7db6bd1f14c888]::thread::Builder>::spawn_unchecked_<rustc_interface[bead3511298ef818]::util::run_in_thread_with_globals<rustc_interface[bead3511298ef818]::util::run_in_thread_pool_with_globals<rustc_interface[bead3511298ef818]::interface::run_compiler<core[8f4b167961bfb5e8]::result::Result<(), rustc_span[7b0df660ef271586]::ErrorGuaranteed>, rustc_driver_impl[ececb8dd003d922]::run_compiler::{closure#0}>::{closure#1}, core[8f4b167961bfb5e8]::result::Result<(), rustc_span[7b0df660ef271586]::ErrorGuaranteed>>::{closure#0}, core[8f4b167961bfb5e8]::result::Result<(), rustc_span[7b0df660ef271586]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[8f4b167961bfb5e8]::result::Result<(), rustc_span[7b0df660ef271586]::ErrorGuaranteed>>::{closure#1} as core[8f4b167961bfb5e8]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  30:     0x75a3abf2a5b9 - std::sys::pal::unix::thread::Thread::new::thread_start::h820907c63bc21811
  31:     0x75a3ad7f539d - <unknown>
  32:     0x75a3ad87a49c - <unknown>
  33:                0x0 - <unknown>

error: 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: please make sure that you have updated to the latest nightly

note: rustc 1.84.0-nightly (4d215e242 2024-11-06) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z validate-mir -C debuginfo=2 -C opt-level=3 -Z dump-mir-dir=dir

query stack during panic:
#0 [optimized_mir] optimizing MIR for `main`
#1 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0050`.

bors added a commit to rust-lang-ci/rust that referenced this issue Nov 26, 2024
…=lcnr

Make `compare_impl_item` into a query

Turns `compare_impl_item` into a query (generalizing the existing query for `compare_impl_const`), and uses that in `Instance::resolve` to fail resolution when an implementation is incompatible with the trait it comes from.

Fixes rust-lang#119701
Fixes rust-lang#121127
Fixes rust-lang#121411
Fixes rust-lang#129075
Fixes rust-lang#129127
Fixes rust-lang#129214
Fixes rust-lang#131294
bors added a commit to rust-lang-ci/rust that referenced this issue Nov 27, 2024
…=lcnr

Make `compare_impl_item` into a query

Turns `compare_impl_item` into a query (generalizing the existing query for `compare_impl_const`), and uses that in `Instance::resolve` to fail resolution when an implementation is incompatible with the trait it comes from.

Fixes rust-lang#119701
Fixes rust-lang#121127
Fixes rust-lang#121411
Fixes rust-lang#129075
Fixes rust-lang#129127
Fixes rust-lang#129214
Fixes rust-lang#131294
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-mir-opt Area: MIR optimizations A-mir-opt-inlining Area: MIR inlining C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ S-bug-has-test Status: This bug is tracked inside the repo by a `known-bug` test. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
3 participants