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 in playground(stable channel, 1.61.0) #97491

Closed
Jagholin opened this issue May 28, 2022 · 3 comments
Closed

ICE in playground(stable channel, 1.61.0) #97491

Jagholin opened this issue May 28, 2022 · 3 comments
Labels
C-bug Category: This is a bug. glacier ICE tracked in rust-lang/glacier. 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

@Jagholin
Copy link

Code

since it's in the playground, here is permalink: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=491e706c54eedac9e3d02498eeddae66

use std::ops::Sub;

trait Vector2 {
    type ScalarType;
    fn from_values(x: Self::ScalarType, y: Self::ScalarType) -> Self
    where Self: Sized;
    fn x(&self) -> Self::ScalarType;
    fn y(&self) -> Self::ScalarType;
}

impl<T> Sub for dyn Vector2<ScalarType=T>
where T: Sub<Output=T>,
(dyn Vector2<ScalarType=T>): Sized{
    type Output = dyn Vector2<ScalarType=T>;
    fn sub(self, rhs: Self) -> Self::Output {
        Self::from_values(self.x()-rhs.x(), self.y() - rhs.y())
    }
}

fn main() {
    
}

Meta

Since it's on the playground, you can change to different versions easily. The ICE also happens in beta and nightly channels(1.63.0-nightly 2022-05-27 ebbcbfc)
rustc --version --verbose:

<version>

Error output

Compiling playground v0.0.1 (/playground)
error: internal compiler error: /rustc/ebbcbfc236ced21d5e6a92269edb704692ff26b8/compiler/rustc_trait_selection/src/traits/util.rs:320:13: get_vtable_index_of_object_method: DefId(0:8 ~ playground[3faf]::Vector2::from_values) was not found

thread 'rustc' panicked at 'Box<dyn Any>', /rustc/ebbcbfc236ced21d5e6a92269edb704692ff26b8/compiler/rustc_errors/src/lib.rs:1334:9
stack backtrace:
   0: std::panicking::begin_panic::<rustc_errors::ExplicitBug>
   1: std::panic::panic_any::<rustc_errors::ExplicitBug>
   2: <rustc_errors::HandlerInner>::bug::<&alloc::string::String>
   3: <rustc_errors::Handler>::bug::<&alloc::string::String>
   4: rustc_middle::ty::context::tls::with_opt::<rustc_middle::util::bug::opt_span_bug_fmt<rustc_span::span_encoding::Span>::{closure#0}, ()>
   5: rustc_middle::util::bug::opt_span_bug_fmt::<rustc_span::span_encoding::Span>
   6: rustc_middle::util::bug::bug_fmt
   7: rustc_trait_selection::traits::util::get_vtable_index_of_object_method::<()>
   8: rustc_ty_utils::instance::inner_resolve_instance
   9: rustc_ty_utils::instance::resolve_instance
  10: rustc_query_system::query::plumbing::get_query::<rustc_query_impl::queries::resolve_instance, rustc_query_impl::plumbing::QueryCtxt>
  11: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::resolve_instance
  12: <rustc_middle::ty::instance::Instance>::resolve
  13: rustc_mir_build::lints::check
  14: <rustc_infer::infer::InferCtxtBuilder>::enter::<rustc_middle::mir::Body, rustc_mir_build::build::mir_build::{closure#1}>
  15: rustc_mir_build::build::mir_built
  16: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::plumbing::QueryCtxt, rustc_query_system::query::caches::DefaultCache<rustc_middle::ty::WithOptConstParam<rustc_span::def_id::LocalDefId>, &rustc_data_structures::steal::Steal<rustc_middle::mir::Body>>>
  17: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::mir_built
  18: rustc_mir_transform::check_unsafety::unsafety_check_result
  19: <rustc_mir_transform::check_unsafety::provide::{closure#0} as core::ops::function::FnOnce<(rustc_middle::ty::context::TyCtxt, rustc_span::def_id::LocalDefId)>>::call_once
  20: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::plumbing::QueryCtxt, rustc_query_system::query::caches::DefaultCache<rustc_span::def_id::LocalDefId, &rustc_middle::mir::query::UnsafetyCheckResult>>
  21: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::unsafety_check_result
  22: rustc_mir_transform::mir_const
  23: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::plumbing::QueryCtxt, rustc_query_system::query::caches::DefaultCache<rustc_middle::ty::WithOptConstParam<rustc_span::def_id::LocalDefId>, &rustc_data_structures::steal::Steal<rustc_middle::mir::Body>>>
  24: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::mir_const
  25: rustc_mir_transform::mir_promoted
  26: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::plumbing::QueryCtxt, rustc_query_system::query::caches::DefaultCache<rustc_middle::ty::WithOptConstParam<rustc_span::def_id::LocalDefId>, (&rustc_data_structures::steal::Steal<rustc_middle::mir::Body>, &rustc_data_structures::steal::Steal<rustc_index::vec::IndexVec<rustc_middle::mir::Promoted, rustc_middle::mir::Body>>)>>
  27: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::mir_promoted
  28: rustc_borrowck::mir_borrowck
  29: <rustc_borrowck::provide::{closure#0} as core::ops::function::FnOnce<(rustc_middle::ty::context::TyCtxt, rustc_span::def_id::LocalDefId)>>::call_once
  30: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::plumbing::QueryCtxt, rustc_query_system::query::caches::DefaultCache<rustc_span::def_id::LocalDefId, &rustc_middle::mir::query::BorrowCheckResult>>
  31: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::mir_borrowck
  32: <rustc_middle::hir::map::Map>::par_body_owners::<rustc_interface::passes::analysis::{closure#2}::{closure#0}>
  33: <rustc_session::session::Session>::time::<(), rustc_interface::passes::analysis::{closure#2}>
  34: rustc_interface::passes::analysis
  35: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::plumbing::QueryCtxt, rustc_query_system::query::caches::DefaultCache<(), core::result::Result<(), rustc_errors::ErrorGuaranteed>>>
  36: rustc_query_system::query::plumbing::get_query::<rustc_query_impl::queries::analysis, rustc_query_impl::plumbing::QueryCtxt>
  37: <rustc_interface::passes::QueryContext>::enter::<rustc_driver::run_compiler::{closure#1}::{closure#2}::{closure#3}, core::result::Result<(), rustc_errors::ErrorGuaranteed>>
  38: <rustc_interface::interface::Compiler>::enter::<rustc_driver::run_compiler::{closure#1}::{closure#2}, core::result::Result<core::option::Option<rustc_interface::queries::Linker>, rustc_errors::ErrorGuaranteed>>
  39: rustc_span::with_source_map::<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_interface::interface::create_compiler_and_run<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_driver::run_compiler::{closure#1}>::{closure#1}>
  40: rustc_interface::interface::create_compiler_and_run::<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_driver::run_compiler::{closure#1}>
  41: <scoped_tls::ScopedKey<rustc_span::SessionGlobals>>::set::<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_driver::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_errors::ErrorGuaranteed>>
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose 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.63.0-nightly (ebbcbfc23 2022-05-27) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type bin -C embed-bitcode=no -C codegen-units=1 -C debuginfo=2

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

query stack during panic:
#0 [resolve_instance] resolving instance `<dyn Vector2<ScalarType = T> as Vector2>::from_values`
#1 [mir_built] building MIR for `<impl at src/main.rs:11:1: 18:2>::sub`
#2 [unsafety_check_result] unsafety-checking `<impl at src/main.rs:11:1: 18:2>::sub`
#3 [mir_const] processing MIR for `<impl at src/main.rs:11:1: 18:2>::sub`
#4 [mir_promoted] processing `<impl at src/main.rs:11:1: 18:2>::sub`
#5 [mir_borrowck] borrow-checking `<impl at src/main.rs:11:1: 18:2>::sub`
#6 [analysis] running analysis passes on this crate
end of query stack
error: could not compile `playground`
Backtrace

 Compiling playground v0.0.1 (/playground)
error: internal compiler error: /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/compiler/rustc_trait_selection/src/traits/util.rs:319:13: get_vtable_index_of_object_method: DefId(0:8 ~ playground[60d4]::Vector2::from_values) was not found

thread 'rustc' panicked at 'Box<dyn Any>', compiler/rustc_errors/src/lib.rs:1279:9
stack backtrace:
   0:     0x7f3fb47a81cd - std::backtrace_rs::backtrace::libunwind::trace::h22893a5306c091b4
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7f3fb47a81cd - std::backtrace_rs::backtrace::trace_unsynchronized::h29c3bc6f9e91819d
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f3fb47a81cd - std::sys_common::backtrace::_print_fmt::he497d8a0ec903793
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/sys_common/backtrace.rs:66:5
   3:     0x7f3fb47a81cd - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h9c2a9d2774d81873
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/sys_common/backtrace.rs:45:22
   4:     0x7f3fb480201c - core::fmt::write::hba4337c43d992f49
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/core/src/fmt/mod.rs:1194:17
   5:     0x7f3fb47997c1 - std::io::Write::write_fmt::heb73de6e02cfabed
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/io/mod.rs:1655:15
   6:     0x7f3fb47ab2b5 - std::sys_common::backtrace::_print::h63c8b24acdd8e8ce
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/sys_common/backtrace.rs:48:5
   7:     0x7f3fb47ab2b5 - std::sys_common::backtrace::print::h426700d6240cdcc2
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/sys_common/backtrace.rs:35:9
   8:     0x7f3fb47ab2b5 - std::panicking::default_hook::{{closure}}::hc9a76eed0b18f82b
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/panicking.rs:295:22
   9:     0x7f3fb47aaf69 - std::panicking::default_hook::h2e88d02087fae196
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/panicking.rs:314:9
  10:     0x7f3fb4f281d1 - rustc_driver[413d55b6344850e3]::DEFAULT_HOOK::{closure#0}::{closure#0}
  11:     0x7f3fb47aba00 - std::panicking::rust_panic_with_hook::habfdcc2e90f9fd4c
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/panicking.rs:702:17
  12:     0x7f3fb5ff8141 - std[3b302b3c9093c22]::panicking::begin_panic::<rustc_errors[a7dbbf867eaca825]::ExplicitBug>::{closure#0}
  13:     0x7f3fb5ff7e96 - std[3b302b3c9093c22]::sys_common::backtrace::__rust_end_short_backtrace::<std[3b302b3c9093c22]::panicking::begin_panic<rustc_errors[a7dbbf867eaca825]::ExplicitBug>::{closure#0}, !>
  14:     0x7f3fb5fff406 - std[3b302b3c9093c22]::panicking::begin_panic::<rustc_errors[a7dbbf867eaca825]::ExplicitBug>
  15:     0x7f3fb600bec6 - std[3b302b3c9093c22]::panic::panic_any::<rustc_errors[a7dbbf867eaca825]::ExplicitBug>
  16:     0x7f3fb600d673 - <rustc_errors[a7dbbf867eaca825]::HandlerInner>::bug
  17:     0x7f3fb600d0d0 - <rustc_errors[a7dbbf867eaca825]::Handler>::bug
  18:     0x7f3fb5f4c636 - rustc_middle[9ca07169fec39ed9]::ty::context::tls::with_opt::<rustc_middle[9ca07169fec39ed9]::util::bug::opt_span_bug_fmt<rustc_span[7238ca7210ca999e]::span_encoding::Span>::{closure#0}, ()>
  19:     0x7f3fb5f4f746 - rustc_middle[9ca07169fec39ed9]::util::bug::opt_span_bug_fmt::<rustc_span[7238ca7210ca999e]::span_encoding::Span>
  20:     0x7f3fb5f4f6c3 - rustc_middle[9ca07169fec39ed9]::util::bug::bug_fmt
  21:     0x7f3fb71246e9 - rustc_trait_selection[2e17e0f1454142da]::traits::util::get_vtable_index_of_object_method::<()>
  22:     0x7f3fb645bcea - rustc_ty_utils[1a711ca447a2a51a]::instance::inner_resolve_instance
  23:     0x7f3fb645a02f - rustc_ty_utils[1a711ca447a2a51a]::instance::resolve_instance
  24:     0x7f3fb6883a54 - rustc_query_system[ac245aac4c1950a0]::query::plumbing::get_query::<rustc_query_impl[b0f4194b24b225ee]::queries::resolve_instance, rustc_query_impl[b0f4194b24b225ee]::plumbing::QueryCtxt>
  25:     0x7f3fb6938868 - <rustc_query_impl[b0f4194b24b225ee]::Queries as rustc_middle[9ca07169fec39ed9]::ty::query::QueryEngine>::resolve_instance
  26:     0x7f3fb6caea00 - <rustc_middle[9ca07169fec39ed9]::ty::instance::Instance>::resolve
  27:     0x7f3fb65cc6d8 - rustc_mir_build[8ab184d73af5ecd6]::lints::check
  28:     0x7f3fb65eef3d - <rustc_infer[2eccd82b53541807]::infer::InferCtxtBuilder>::enter::<rustc_middle[9ca07169fec39ed9]::mir::Body, rustc_mir_build[8ab184d73af5ecd6]::build::mir_build::{closure#1}>
  29:     0x7f3fb6597d5b - rustc_mir_build[8ab184d73af5ecd6]::build::mir_built
  30:     0x7f3fb6843461 - rustc_query_system[ac245aac4c1950a0]::query::plumbing::try_execute_query::<rustc_query_impl[b0f4194b24b225ee]::plumbing::QueryCtxt, rustc_query_system[ac245aac4c1950a0]::query::caches::DefaultCache<rustc_middle[9ca07169fec39ed9]::ty::WithOptConstParam<rustc_span[7238ca7210ca999e]::def_id::LocalDefId>, &rustc_data_structures[29dbb8437998f908]::steal::Steal<rustc_middle[9ca07169fec39ed9]::mir::Body>>>
  31:     0x7f3fb6933de5 - <rustc_query_impl[b0f4194b24b225ee]::Queries as rustc_middle[9ca07169fec39ed9]::ty::query::QueryEngine>::mir_built
  32:     0x7f3fb62c2827 - rustc_mir_transform[cb5ca09968a8da5d]::check_unsafety::unsafety_check_result
  33:     0x7f3fb62be030 - <rustc_mir_transform[cb5ca09968a8da5d]::check_unsafety::provide::{closure#0} as core[a3420257622cd381]::ops::function::FnOnce<(rustc_middle[9ca07169fec39ed9]::ty::context::TyCtxt, rustc_span[7238ca7210ca999e]::def_id::LocalDefId)>>::call_once
  34:     0x7f3fb6856467 - rustc_query_system[ac245aac4c1950a0]::query::plumbing::try_execute_query::<rustc_query_impl[b0f4194b24b225ee]::plumbing::QueryCtxt, rustc_query_system[ac245aac4c1950a0]::query::caches::DefaultCache<rustc_span[7238ca7210ca999e]::def_id::LocalDefId, &rustc_middle[9ca07169fec39ed9]::mir::query::UnsafetyCheckResult>>
  35:     0x7f3fb693515e - <rustc_query_impl[b0f4194b24b225ee]::Queries as rustc_middle[9ca07169fec39ed9]::ty::query::QueryEngine>::unsafety_check_result
  36:     0x7f3fb629c4ee - rustc_mir_transform[cb5ca09968a8da5d]::mir_const
  37:     0x7f3fb6843461 - rustc_query_system[ac245aac4c1950a0]::query::plumbing::try_execute_query::<rustc_query_impl[b0f4194b24b225ee]::plumbing::QueryCtxt, rustc_query_system[ac245aac4c1950a0]::query::caches::DefaultCache<rustc_middle[9ca07169fec39ed9]::ty::WithOptConstParam<rustc_span[7238ca7210ca999e]::def_id::LocalDefId>, &rustc_data_structures[29dbb8437998f908]::steal::Steal<rustc_middle[9ca07169fec39ed9]::mir::Body>>>
  38:     0x7f3fb6933f1c - <rustc_query_impl[b0f4194b24b225ee]::Queries as rustc_middle[9ca07169fec39ed9]::ty::query::QueryEngine>::mir_const
  39:     0x7f3fb629dfe5 - rustc_mir_transform[cb5ca09968a8da5d]::mir_promoted
  40:     0x7f3fb6844969 - rustc_query_system[ac245aac4c1950a0]::query::plumbing::try_execute_query::<rustc_query_impl[b0f4194b24b225ee]::plumbing::QueryCtxt, rustc_query_system[ac245aac4c1950a0]::query::caches::DefaultCache<rustc_middle[9ca07169fec39ed9]::ty::WithOptConstParam<rustc_span[7238ca7210ca999e]::def_id::LocalDefId>, (&rustc_data_structures[29dbb8437998f908]::steal::Steal<rustc_middle[9ca07169fec39ed9]::mir::Body>, &rustc_data_structures[29dbb8437998f908]::steal::Steal<rustc_index[db082642455f6dc9]::vec::IndexVec<rustc_middle[9ca07169fec39ed9]::mir::Promoted, rustc_middle[9ca07169fec39ed9]::mir::Body>>)>>
  41:     0x7f3fb6934334 - <rustc_query_impl[b0f4194b24b225ee]::Queries as rustc_middle[9ca07169fec39ed9]::ty::query::QueryEngine>::mir_promoted
  42:     0x7f3fb66c1bc9 - rustc_borrowck[20c91c3baf1e28a2]::mir_borrowck
  43:     0x7f3fb66bebb0 - <rustc_borrowck[20c91c3baf1e28a2]::provide::{closure#0} as core[a3420257622cd381]::ops::function::FnOnce<(rustc_middle[9ca07169fec39ed9]::ty::context::TyCtxt, rustc_span[7238ca7210ca999e]::def_id::LocalDefId)>>::call_once
  44:     0x7f3fb6855461 - rustc_query_system[ac245aac4c1950a0]::query::plumbing::try_execute_query::<rustc_query_impl[b0f4194b24b225ee]::plumbing::QueryCtxt, rustc_query_system[ac245aac4c1950a0]::query::caches::DefaultCache<rustc_span[7238ca7210ca999e]::def_id::LocalDefId, &rustc_middle[9ca07169fec39ed9]::mir::query::BorrowCheckResult>>
  45:     0x7f3fb69357ca - <rustc_query_impl[b0f4194b24b225ee]::Queries as rustc_middle[9ca07169fec39ed9]::ty::query::QueryEngine>::mir_borrowck
  46:     0x7f3fb615584f - <rustc_session[8df92abe178df33c]::session::Session>::time::<(), rustc_interface[550884b2b179878f]::passes::analysis::{closure#2}>
  47:     0x7f3fb6e2ab45 - rustc_interface[550884b2b179878f]::passes::analysis
  48:     0x7f3fb72f0dee - rustc_query_system[ac245aac4c1950a0]::query::plumbing::try_execute_query::<rustc_query_impl[b0f4194b24b225ee]::plumbing::QueryCtxt, rustc_query_system[ac245aac4c1950a0]::query::caches::DefaultCache<(), core[a3420257622cd381]::result::Result<(), rustc_errors[a7dbbf867eaca825]::ErrorGuaranteed>>>
  49:     0x7f3fb7333dfe - rustc_query_system[ac245aac4c1950a0]::query::plumbing::get_query::<rustc_query_impl[b0f4194b24b225ee]::queries::analysis, rustc_query_impl[b0f4194b24b225ee]::plumbing::QueryCtxt>
  50:     0x7f3fb6df0881 - <rustc_interface[550884b2b179878f]::passes::QueryContext>::enter::<rustc_driver[413d55b6344850e3]::run_compiler::{closure#1}::{closure#2}::{closure#3}, core[a3420257622cd381]::result::Result<(), rustc_errors[a7dbbf867eaca825]::ErrorGuaranteed>>
  51:     0x7f3fb6e0aa58 - <rustc_interface[550884b2b179878f]::interface::Compiler>::enter::<rustc_driver[413d55b6344850e3]::run_compiler::{closure#1}::{closure#2}, core[a3420257622cd381]::result::Result<core[a3420257622cd381]::option::Option<rustc_interface[550884b2b179878f]::queries::Linker>, rustc_errors[a7dbbf867eaca825]::ErrorGuaranteed>>
  52:     0x7f3fb6df003f - rustc_span[7238ca7210ca999e]::with_source_map::<core[a3420257622cd381]::result::Result<(), rustc_errors[a7dbbf867eaca825]::ErrorGuaranteed>, rustc_interface[550884b2b179878f]::interface::create_compiler_and_run<core[a3420257622cd381]::result::Result<(), rustc_errors[a7dbbf867eaca825]::ErrorGuaranteed>, rustc_driver[413d55b6344850e3]::run_compiler::{closure#1}>::{closure#1}>
  53:     0x7f3fb6e0c0a4 - rustc_interface[550884b2b179878f]::interface::create_compiler_and_run::<core[a3420257622cd381]::result::Result<(), rustc_errors[a7dbbf867eaca825]::ErrorGuaranteed>, rustc_driver[413d55b6344850e3]::run_compiler::{closure#1}>
  54:     0x7f3fb6dee7c2 - <scoped_tls[7ed3ce20ede545d8]::ScopedKey<rustc_span[7238ca7210ca999e]::SessionGlobals>>::set::<rustc_interface[550884b2b179878f]::interface::run_compiler<core[a3420257622cd381]::result::Result<(), rustc_errors[a7dbbf867eaca825]::ErrorGuaranteed>, rustc_driver[413d55b6344850e3]::run_compiler::{closure#1}>::{closure#0}, core[a3420257622cd381]::result::Result<(), rustc_errors[a7dbbf867eaca825]::ErrorGuaranteed>>
  55:     0x7f3fb6e0438f - std[3b302b3c9093c22]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[550884b2b179878f]::util::run_in_thread_pool_with_globals<rustc_interface[550884b2b179878f]::interface::run_compiler<core[a3420257622cd381]::result::Result<(), rustc_errors[a7dbbf867eaca825]::ErrorGuaranteed>, rustc_driver[413d55b6344850e3]::run_compiler::{closure#1}>::{closure#0}, core[a3420257622cd381]::result::Result<(), rustc_errors[a7dbbf867eaca825]::ErrorGuaranteed>>::{closure#0}, core[a3420257622cd381]::result::Result<(), rustc_errors[a7dbbf867eaca825]::ErrorGuaranteed>>
  56:     0x7f3fb6defaf9 - <<std[3b302b3c9093c22]::thread::Builder>::spawn_unchecked_<rustc_interface[550884b2b179878f]::util::run_in_thread_pool_with_globals<rustc_interface[550884b2b179878f]::interface::run_compiler<core[a3420257622cd381]::result::Result<(), rustc_errors[a7dbbf867eaca825]::ErrorGuaranteed>, rustc_driver[413d55b6344850e3]::run_compiler::{closure#1}>::{closure#0}, core[a3420257622cd381]::result::Result<(), rustc_errors[a7dbbf867eaca825]::ErrorGuaranteed>>::{closure#0}, core[a3420257622cd381]::result::Result<(), rustc_errors[a7dbbf867eaca825]::ErrorGuaranteed>>::{closure#1} as core[a3420257622cd381]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  57:     0x7f3fb47b5bf3 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::ha99802c2c52ada61
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/alloc/src/boxed.rs:1861:9
  58:     0x7f3fb47b5bf3 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::ha39aea1c57e28a15
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/alloc/src/boxed.rs:1861:9
  59:     0x7f3fb47b5bf3 - std::sys::unix::thread::Thread::new::thread_start::h9f8e3d72b1f7662f
                               at /rustc/fe5b13d681f25ee6474be29d748c65adcd91f69e/library/std/src/sys/unix/thread.rs:108:17
  60:     0x7f3fb46e5609 - start_thread
  61:     0x7f3fb45fe133 - clone
  62:                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.61.0 (fe5b13d68 2022-05-18) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type bin -C embed-bitcode=no -C codegen-units=1 -C debuginfo=2

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

query stack during panic:
#0 [resolve_instance] resolving instance `<dyn Vector2<ScalarType = T> as Vector2>::from_values`
#1 [mir_built] building MIR for `<impl at src/main.rs:11:1: 18:2>::sub`
#2 [unsafety_check_result] unsafety-checking `<impl at src/main.rs:11:1: 18:2>::sub`
#3 [mir_const] processing MIR for `<impl at src/main.rs:11:1: 18:2>::sub`
#4 [mir_promoted] processing `<impl at src/main.rs:11:1: 18:2>::sub`
#5 [mir_borrowck] borrow-checking `<impl at src/main.rs:11:1: 18:2>::sub`
#6 [analysis] running analysis passes on this crate
end of query stack
error: could not compile `playground`

@Jagholin Jagholin 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 May 28, 2022
@compiler-errors
Copy link
Member

compiler-errors commented May 28, 2022

This is due to a trivially unsatisfiable bound. dyn Trait: Sized is always false. We can probably add a check for this in get_vtable_index_of_object_method?

@JohnTitor
Copy link
Member

Fixed by #97595, adding E-needs-test.

@JohnTitor
Copy link
Member

Wait, it has a regression test covering this case, closing.

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. glacier ICE tracked in rust-lang/glacier. 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

4 participants