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

Higher-Ranked Trait Bounds Crash the Compiler #109201

Closed
MMukundi opened this issue Mar 16, 2023 · 1 comment
Closed

Higher-Ranked Trait Bounds Crash the Compiler #109201

MMukundi opened this issue Mar 16, 2023 · 1 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.

Comments

@MMukundi
Copy link

MMukundi commented Mar 16, 2023

Code

pub trait Trait { type Item; }
impl <T> Trait for T
    where
        for<'a> &'a T: Trait,
        for<'a> <&'a T>::Item: Clone,
{}

Playground
Interestingly, this also crashes in the same way

  • even if the associated type is named "Iter", "Output", and several other names,
  • even if the associated type is not present in the trait,
  • and no matter what trait is used for the bound
pub trait Trait { }
impl <T> Trait for T
    where
        for<'a> &'a T: Trait,
        for<'a> <&'a T>::Output: Trait,
{}

Playground
It does not crash when fully qualified syntax is used:

pub trait Trait { }
impl <T> Trait for T
    where
        for<'a> &'a T: Trait,
        for<'a> <&'a T as Trait>::Output: Trait,
{}

Playground

Meta

This bug only exists on stable. Based on what happens in a successful run on nightly

error[[E0223]](https://doc.rust-lang.org/nightly/error_codes/E0223.html): ambiguous associated type
 --> src/lib.rs:5:17
  |
5 |         for<'a> <&'a T>::Output: Clone,
  |                 ^^^^^^^^^^^^^^^
  |
help: use the fully-qualified path
  |
5 |         for<'a> <&'a T as FnOnce>::Output: Clone,
  |                 ~~~~~~~~~~~~~~~~~~~~~~~~~
5 |         for<'a> <&'a T as IntoFuture>::Output: Clone,

it seems that something is going wrong when attempting to provide help messages for E0223

rustc --version --verbose:

rustc 1.68.0 (2c8cc3432 2023-03-06)
binary: rustc
commit-hash: 2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74
commit-date: 2023-03-06
host: aarch64-apple-darwin
release: 1.68.0
LLVM version: 15.0.6

Error output

error: internal compiler error: compiler/rustc_infer/src/infer/region_constraints/mod.rs:568:17: cannot relate bound region: ReErased <= ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed(DefId(0:7 ~ playground[e57e]::{impl#0}::'a#1), 'a) })
Backtrace

   Compiling playground v0.0.1 (/playground)
error: internal compiler error: compiler/rustc_infer/src/infer/region_constraints/mod.rs:568:17: cannot relate bound region: ReErased <= ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed(DefId(0:7 ~ playground[e57e]::{impl#0}::'a#1), 'a) })

thread 'rustc' panicked at 'Box<dyn Any>', /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/compiler/rustc_errors/src/lib.rs:987:33
stack backtrace:
   0:     0x7fdfb027659a - std::backtrace_rs::backtrace::libunwind::trace::h595f06c70adcc478
                               at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7fdfb027659a - std::backtrace_rs::backtrace::trace_unsynchronized::h177a0149c76cdde9
                               at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7fdfb027659a - std::sys_common::backtrace::_print_fmt::hc0701fd2c3530c58
                               at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x7fdfb027659a - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hd4cd115d8750fd6c
                               at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7fdfb02d839e - core::fmt::write::h93e2f5923c7eca08
                               at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/core/src/fmt/mod.rs:1213:17
   5:     0x7fdfb0266be5 - std::io::Write::write_fmt::h8162dbb45f0b9e62
                               at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/std/src/io/mod.rs:1682:15
   6:     0x7fdfb0276365 - std::sys_common::backtrace::_print::h1835ef8a8f9066da
                               at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/std/src/sys_common/backtrace.rs:47:5
   7:     0x7fdfb0276365 - std::sys_common::backtrace::print::hcb5e6388b9235f41
                               at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/std/src/sys_common/backtrace.rs:34:9
   8:     0x7fdfb027912f - std::panicking::default_hook::{{closure}}::h9c084969ccf9a722
                               at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/std/src/panicking.rs:267:22
   9:     0x7fdfb0278e6b - std::panicking::default_hook::h68fa2ba3c3c6c12f
                               at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/std/src/panicking.rs:286:9
  10:     0x7fdfb35c56e4 - <rustc_driver[f4ad927b3c57833d]::DEFAULT_HOOK::{closure#0}::{closure#0} as core[d16e85342ea223d9]::ops::function::FnOnce<(&core[d16e85342ea223d9]::panic::panic_info::PanicInfo,)>>::call_once::{shim:vtable#0}
  11:     0x7fdfb027996a - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h4e6ced11e07d8b24
                               at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/alloc/src/boxed.rs:2002:9
  12:     0x7fdfb027996a - std::panicking::rust_panic_with_hook::h8d5c434518ef298c
                               at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/std/src/panicking.rs:692:13
  13:     0x7fdfb3881501 - std[3da461b304582a2c]::panicking::begin_panic::<rustc_errors[41d09747e2f98dea]::ExplicitBug>::{closure#0}
  14:     0x7fdfb3879e56 - std[3da461b304582a2c]::sys_common::backtrace::__rust_end_short_backtrace::<std[3da461b304582a2c]::panicking::begin_panic<rustc_errors[41d09747e2f98dea]::ExplicitBug>::{closure#0}, !>
  15:     0x7fdfb3909df6 - std[3da461b304582a2c]::panicking::begin_panic::<rustc_errors[41d09747e2f98dea]::ExplicitBug>
  16:     0x7fdfb3909de6 - std[3da461b304582a2c]::panic::panic_any::<rustc_errors[41d09747e2f98dea]::ExplicitBug>
  17:     0x7fdfb3908b92 - <rustc_errors[41d09747e2f98dea]::HandlerInner>::span_bug::<rustc_span[4bb3e3ecb57f95d5]::span_encoding::Span, &alloc[5b05b59796bdfb5c]::string::String>
  18:     0x7fdfb3908a37 - <rustc_errors[41d09747e2f98dea]::Handler>::span_bug::<rustc_span[4bb3e3ecb57f95d5]::span_encoding::Span, &alloc[5b05b59796bdfb5c]::string::String>
  19:     0x7fdfb38bdf9b - rustc_middle[eb7209f5870e9fb7]::util::bug::opt_span_bug_fmt::<rustc_span[4bb3e3ecb57f95d5]::span_encoding::Span>::{closure#0}
  20:     0x7fdfb38bdfea - rustc_middle[eb7209f5870e9fb7]::ty::context::tls::with_opt::<rustc_middle[eb7209f5870e9fb7]::util::bug::opt_span_bug_fmt<rustc_span[4bb3e3ecb57f95d5]::span_encoding::Span>::{closure#0}, !>::{closure#0}
  21:     0x7fdfb38bd0aa - rustc_middle[eb7209f5870e9fb7]::ty::context::tls::with_context_opt::<rustc_middle[eb7209f5870e9fb7]::ty::context::tls::with_opt<rustc_middle[eb7209f5870e9fb7]::util::bug::opt_span_bug_fmt<rustc_span[4bb3e3ecb57f95d5]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
  22:     0x7fdfb38bcfd6 - rustc_middle[eb7209f5870e9fb7]::util::bug::opt_span_bug_fmt::<rustc_span[4bb3e3ecb57f95d5]::span_encoding::Span>
  23:     0x7fdfb38bcf94 - rustc_middle[eb7209f5870e9fb7]::util::bug::span_bug_fmt::<rustc_span[4bb3e3ecb57f95d5]::span_encoding::Span>
  24:     0x7fdfb1553fa4 - <rustc_middle[eb7209f5870e9fb7]::ty::sty::Region as rustc_middle[eb7209f5870e9fb7]::ty::relate::Relate>::relate::<rustc_infer[41785f830319e09c]::infer::equate::Equate>
  25:     0x7fdfb154e926 - rustc_middle[eb7209f5870e9fb7]::ty::relate::super_relate_tys::<rustc_infer[41785f830319e09c]::infer::equate::Equate>
  26:     0x7fdfb154c25e - <rustc_infer[41785f830319e09c]::infer::equate::Equate as rustc_middle[eb7209f5870e9fb7]::ty::relate::TypeRelation>::tys
  27:     0x7fdfb25d106f - <rustc_infer[41785f830319e09c]::infer::at::At>::eq::<rustc_middle[eb7209f5870e9fb7]::ty::Ty>
  28:     0x7fdfb25d0cfd - <rustc_infer[41785f830319e09c]::infer::InferCtxt>::can_eq::<rustc_middle[eb7209f5870e9fb7]::ty::Ty>
  29:     0x7fdfb3722467 - <&mut core[d16e85342ea223d9]::iter::adapters::cloned::clone_try_fold<rustc_span[4bb3e3ecb57f95d5]::def_id::DefId, (), core[d16e85342ea223d9]::ops::control_flow::ControlFlow<()>, core[d16e85342ea223d9]::iter::traits::iterator::Iterator::any::check<rustc_span[4bb3e3ecb57f95d5]::def_id::DefId, <dyn rustc_hir_analysis[9174c993ab369dfd]::astconv::AstConv>::associated_path_to_ty::{closure#0}::{closure#6}::{closure#1}>::{closure#0}>::{closure#0} as core[d16e85342ea223d9]::ops::function::FnMut<((), &rustc_span[4bb3e3ecb57f95d5]::def_id::DefId)>>::call_mut
  30:     0x7fdfb36ed962 - <core[d16e85342ea223d9]::iter::adapters::map::Map<indexmap[9988f166547f0fb5]::map::Iter<rustc_middle[eb7209f5870e9fb7]::ty::fast_reject::SimplifiedType, alloc[5b05b59796bdfb5c]::vec::Vec<rustc_span[4bb3e3ecb57f95d5]::def_id::DefId>>, <rustc_middle[eb7209f5870e9fb7]::ty::context::TyCtxt>::all_impls::{closure#0}> as core[d16e85342ea223d9]::iter::traits::iterator::Iterator>::try_fold::<(), <core[d16e85342ea223d9]::iter::adapters::flatten::FlattenCompat<_, _>>::iter_try_fold::flatten<&alloc[5b05b59796bdfb5c]::vec::Vec<rustc_span[4bb3e3ecb57f95d5]::def_id::DefId>, (), core[d16e85342ea223d9]::ops::control_flow::ControlFlow<()>, <core[d16e85342ea223d9]::iter::adapters::flatten::FlattenCompat<_, _> as core[d16e85342ea223d9]::iter::traits::iterator::Iterator>::try_fold::flatten<core[d16e85342ea223d9]::slice::iter::Iter<rustc_span[4bb3e3ecb57f95d5]::def_id::DefId>, (), core[d16e85342ea223d9]::ops::control_flow::ControlFlow<()>, core[d16e85342ea223d9]::iter::adapters::cloned::clone_try_fold<rustc_span[4bb3e3ecb57f95d5]::def_id::DefId, (), core[d16e85342ea223d9]::ops::control_flow::ControlFlow<()>, core[d16e85342ea223d9]::iter::traits::iterator::Iterator::any::check<rustc_span[4bb3e3ecb57f95d5]::def_id::DefId, <dyn rustc_hir_analysis[9174c993ab369dfd]::astconv::AstConv>::associated_path_to_ty::{closure#0}::{closure#6}::{closure#1}>::{closure#0}>::{closure#0}>::{closure#0}>::{closure#0}, core[d16e85342ea223d9]::ops::control_flow::ControlFlow<()>>
  31:     0x7fdfb370cafe - <core[d16e85342ea223d9]::iter::adapters::chain::Chain<core[d16e85342ea223d9]::slice::iter::Iter<rustc_span[4bb3e3ecb57f95d5]::def_id::DefId>, core[d16e85342ea223d9]::iter::adapters::flatten::FlatMap<indexmap[9988f166547f0fb5]::map::Iter<rustc_middle[eb7209f5870e9fb7]::ty::fast_reject::SimplifiedType, alloc[5b05b59796bdfb5c]::vec::Vec<rustc_span[4bb3e3ecb57f95d5]::def_id::DefId>>, &alloc[5b05b59796bdfb5c]::vec::Vec<rustc_span[4bb3e3ecb57f95d5]::def_id::DefId>, <rustc_middle[eb7209f5870e9fb7]::ty::context::TyCtxt>::all_impls::{closure#0}>> as core[d16e85342ea223d9]::iter::traits::iterator::Iterator>::try_fold::<(), core[d16e85342ea223d9]::iter::adapters::cloned::clone_try_fold<rustc_span[4bb3e3ecb57f95d5]::def_id::DefId, (), core[d16e85342ea223d9]::ops::control_flow::ControlFlow<()>, core[d16e85342ea223d9]::iter::traits::iterator::Iterator::any::check<rustc_span[4bb3e3ecb57f95d5]::def_id::DefId, <dyn rustc_hir_analysis[9174c993ab369dfd]::astconv::AstConv>::associated_path_to_ty::{closure#0}::{closure#6}::{closure#1}>::{closure#0}>::{closure#0}, core[d16e85342ea223d9]::ops::control_flow::ControlFlow<()>>
  32:     0x7fdfb36be7c8 - <&mut <dyn rustc_hir_analysis[9174c993ab369dfd]::astconv::AstConv>::associated_path_to_ty::{closure#0}::{closure#6} as core[d16e85342ea223d9]::ops::function::FnMut<(&rustc_span[4bb3e3ecb57f95d5]::def_id::DefId,)>>::call_mut
  33:     0x7fdfb36d615a - <&mut core[d16e85342ea223d9]::iter::traits::iterator::Iterator::find::check<rustc_span[4bb3e3ecb57f95d5]::def_id::DefId, &mut <dyn rustc_hir_analysis[9174c993ab369dfd]::astconv::AstConv>::associated_path_to_ty::{closure#0}::{closure#6}>::{closure#0} as core[d16e85342ea223d9]::ops::function::FnMut<((), rustc_span[4bb3e3ecb57f95d5]::def_id::DefId)>>::call_mut
  34:     0x7fdfb3705f33 - <core[d16e85342ea223d9]::iter::adapters::copied::Copied<core[d16e85342ea223d9]::slice::iter::Iter<rustc_span[4bb3e3ecb57f95d5]::def_id::DefId>> as core[d16e85342ea223d9]::iter::traits::iterator::Iterator>::try_fold::<(), &mut core[d16e85342ea223d9]::iter::traits::iterator::Iterator::find::check<rustc_span[4bb3e3ecb57f95d5]::def_id::DefId, &mut <dyn rustc_hir_analysis[9174c993ab369dfd]::astconv::AstConv>::associated_path_to_ty::{closure#0}::{closure#6}>::{closure#0}, core[d16e85342ea223d9]::ops::control_flow::ControlFlow<rustc_span[4bb3e3ecb57f95d5]::def_id::DefId>>
  35:     0x7fdfb370600a - <core[d16e85342ea223d9]::iter::adapters::copied::Copied<core[d16e85342ea223d9]::slice::iter::Iter<rustc_span[4bb3e3ecb57f95d5]::def_id::CrateNum>> as core[d16e85342ea223d9]::iter::traits::iterator::Iterator>::try_fold::<(), core[d16e85342ea223d9]::iter::adapters::map::map_try_fold<rustc_span[4bb3e3ecb57f95d5]::def_id::CrateNum, core[d16e85342ea223d9]::iter::adapters::copied::Copied<core[d16e85342ea223d9]::slice::iter::Iter<rustc_span[4bb3e3ecb57f95d5]::def_id::DefId>>, (), core[d16e85342ea223d9]::ops::control_flow::ControlFlow<rustc_span[4bb3e3ecb57f95d5]::def_id::DefId>, <rustc_middle[eb7209f5870e9fb7]::ty::context::TyCtxt>::all_traits::{closure#0}, <core[d16e85342ea223d9]::iter::adapters::flatten::FlattenCompat<_, _>>::iter_try_fold::flatten<core[d16e85342ea223d9]::iter::adapters::copied::Copied<core[d16e85342ea223d9]::slice::iter::Iter<rustc_span[4bb3e3ecb57f95d5]::def_id::DefId>>, (), core[d16e85342ea223d9]::ops::control_flow::ControlFlow<rustc_span[4bb3e3ecb57f95d5]::def_id::DefId>, <core[d16e85342ea223d9]::iter::adapters::flatten::FlattenCompat<_, _> as core[d16e85342ea223d9]::iter::traits::iterator::Iterator>::try_fold::flatten<core[d16e85342ea223d9]::iter::adapters::copied::Copied<core[d16e85342ea223d9]::slice::iter::Iter<rustc_span[4bb3e3ecb57f95d5]::def_id::DefId>>, (), core[d16e85342ea223d9]::ops::control_flow::ControlFlow<rustc_span[4bb3e3ecb57f95d5]::def_id::DefId>, core[d16e85342ea223d9]::iter::traits::iterator::Iterator::find::check<rustc_span[4bb3e3ecb57f95d5]::def_id::DefId, &mut <dyn rustc_hir_analysis[9174c993ab369dfd]::astconv::AstConv>::associated_path_to_ty::{closure#0}::{closure#6}>::{closure#0}>::{closure#0}>::{closure#0}>::{closure#0}, core[d16e85342ea223d9]::ops::control_flow::ControlFlow<rustc_span[4bb3e3ecb57f95d5]::def_id::DefId>>
  36:     0x7fdfb370c8a9 - <core[d16e85342ea223d9]::iter::adapters::chain::Chain<core[d16e85342ea223d9]::iter::sources::once::Once<rustc_span[4bb3e3ecb57f95d5]::def_id::CrateNum>, core[d16e85342ea223d9]::iter::adapters::copied::Copied<core[d16e85342ea223d9]::slice::iter::Iter<rustc_span[4bb3e3ecb57f95d5]::def_id::CrateNum>>> as core[d16e85342ea223d9]::iter::traits::iterator::Iterator>::try_fold::<(), core[d16e85342ea223d9]::iter::adapters::map::map_try_fold<rustc_span[4bb3e3ecb57f95d5]::def_id::CrateNum, core[d16e85342ea223d9]::iter::adapters::copied::Copied<core[d16e85342ea223d9]::slice::iter::Iter<rustc_span[4bb3e3ecb57f95d5]::def_id::DefId>>, (), core[d16e85342ea223d9]::ops::control_flow::ControlFlow<rustc_span[4bb3e3ecb57f95d5]::def_id::DefId>, <rustc_middle[eb7209f5870e9fb7]::ty::context::TyCtxt>::all_traits::{closure#0}, <core[d16e85342ea223d9]::iter::adapters::flatten::FlattenCompat<_, _>>::iter_try_fold::flatten<core[d16e85342ea223d9]::iter::adapters::copied::Copied<core[d16e85342ea223d9]::slice::iter::Iter<rustc_span[4bb3e3ecb57f95d5]::def_id::DefId>>, (), core[d16e85342ea223d9]::ops::control_flow::ControlFlow<rustc_span[4bb3e3ecb57f95d5]::def_id::DefId>, <core[d16e85342ea223d9]::iter::adapters::flatten::FlattenCompat<_, _> as core[d16e85342ea223d9]::iter::traits::iterator::Iterator>::try_fold::flatten<core[d16e85342ea223d9]::iter::adapters::copied::Copied<core[d16e85342ea223d9]::slice::iter::Iter<rustc_span[4bb3e3ecb57f95d5]::def_id::DefId>>, (), core[d16e85342ea223d9]::ops::control_flow::ControlFlow<rustc_span[4bb3e3ecb57f95d5]::def_id::DefId>, core[d16e85342ea223d9]::iter::traits::iterator::Iterator::find::check<rustc_span[4bb3e3ecb57f95d5]::def_id::DefId, &mut <dyn rustc_hir_analysis[9174c993ab369dfd]::astconv::AstConv>::associated_path_to_ty::{closure#0}::{closure#6}>::{closure#0}>::{closure#0}>::{closure#0}>::{closure#0}, core[d16e85342ea223d9]::ops::control_flow::ControlFlow<rustc_span[4bb3e3ecb57f95d5]::def_id::DefId>>
  37:     0x7fdfb36ed11e - <core[d16e85342ea223d9]::iter::adapters::map::Map<core[d16e85342ea223d9]::iter::adapters::chain::Chain<core[d16e85342ea223d9]::iter::sources::once::Once<rustc_span[4bb3e3ecb57f95d5]::def_id::CrateNum>, core[d16e85342ea223d9]::iter::adapters::copied::Copied<core[d16e85342ea223d9]::slice::iter::Iter<rustc_span[4bb3e3ecb57f95d5]::def_id::CrateNum>>>, <rustc_middle[eb7209f5870e9fb7]::ty::context::TyCtxt>::all_traits::{closure#0}> as core[d16e85342ea223d9]::iter::traits::iterator::Iterator>::try_fold::<(), <core[d16e85342ea223d9]::iter::adapters::flatten::FlattenCompat<_, _>>::iter_try_fold::flatten<core[d16e85342ea223d9]::iter::adapters::copied::Copied<core[d16e85342ea223d9]::slice::iter::Iter<rustc_span[4bb3e3ecb57f95d5]::def_id::DefId>>, (), core[d16e85342ea223d9]::ops::control_flow::ControlFlow<rustc_span[4bb3e3ecb57f95d5]::def_id::DefId>, <core[d16e85342ea223d9]::iter::adapters::flatten::FlattenCompat<_, _> as core[d16e85342ea223d9]::iter::traits::iterator::Iterator>::try_fold::flatten<core[d16e85342ea223d9]::iter::adapters::copied::Copied<core[d16e85342ea223d9]::slice::iter::Iter<rustc_span[4bb3e3ecb57f95d5]::def_id::DefId>>, (), core[d16e85342ea223d9]::ops::control_flow::ControlFlow<rustc_span[4bb3e3ecb57f95d5]::def_id::DefId>, core[d16e85342ea223d9]::iter::traits::iterator::Iterator::find::check<rustc_span[4bb3e3ecb57f95d5]::def_id::DefId, &mut <dyn rustc_hir_analysis[9174c993ab369dfd]::astconv::AstConv>::associated_path_to_ty::{closure#0}::{closure#6}>::{closure#0}>::{closure#0}>::{closure#0}, core[d16e85342ea223d9]::ops::control_flow::ControlFlow<rustc_span[4bb3e3ecb57f95d5]::def_id::DefId>>
  38:     0x7fdfb36fa4f7 - <alloc[5b05b59796bdfb5c]::vec::Vec<alloc[5b05b59796bdfb5c]::string::String> as alloc[5b05b59796bdfb5c]::vec::spec_from_iter::SpecFromIter<alloc[5b05b59796bdfb5c]::string::String, core[d16e85342ea223d9]::iter::adapters::map::Map<core[d16e85342ea223d9]::iter::adapters::filter::Filter<core[d16e85342ea223d9]::iter::adapters::flatten::FlatMap<core[d16e85342ea223d9]::iter::adapters::chain::Chain<core[d16e85342ea223d9]::iter::sources::once::Once<rustc_span[4bb3e3ecb57f95d5]::def_id::CrateNum>, core[d16e85342ea223d9]::iter::adapters::copied::Copied<core[d16e85342ea223d9]::slice::iter::Iter<rustc_span[4bb3e3ecb57f95d5]::def_id::CrateNum>>>, core[d16e85342ea223d9]::iter::adapters::copied::Copied<core[d16e85342ea223d9]::slice::iter::Iter<rustc_span[4bb3e3ecb57f95d5]::def_id::DefId>>, <rustc_middle[eb7209f5870e9fb7]::ty::context::TyCtxt>::all_traits::{closure#0}>, <dyn rustc_hir_analysis[9174c993ab369dfd]::astconv::AstConv>::associated_path_to_ty::{closure#0}::{closure#6}>, <dyn rustc_hir_analysis[9174c993ab369dfd]::astconv::AstConv>::associated_path_to_ty::{closure#0}::{closure#7}>>>::from_iter
  39:     0x7fdfb20f64cf - <dyn rustc_hir_analysis[9174c993ab369dfd]::astconv::AstConv>::associated_path_to_ty::{closure#0}
  40:     0x7fdfb20dddb7 - <dyn rustc_hir_analysis[9174c993ab369dfd]::astconv::AstConv>::ast_ty_to_ty_inner::{closure#0}
  41:     0x7fdfb1c515b8 - rustc_hir_analysis[9174c993ab369dfd]::collect::predicates_of::gather_explicit_predicates_of
  42:     0x7fdfb1c46315 - rustc_query_system[e5b40bf290de15d8]::query::plumbing::get_query::<rustc_query_impl[3a6baddf07124ab7]::queries::explicit_predicates_of, rustc_query_impl[3a6baddf07124ab7]::plumbing::QueryCtxt, rustc_middle[eb7209f5870e9fb7]::dep_graph::dep_node::DepKind>
  43:     0x7fdfb2218616 - rustc_hir_analysis[9174c993ab369dfd]::collect::predicates_of::predicates_of
  44:     0x7fdfb22157f6 - rustc_query_system[e5b40bf290de15d8]::query::plumbing::get_query::<rustc_query_impl[3a6baddf07124ab7]::queries::predicates_of, rustc_query_impl[3a6baddf07124ab7]::plumbing::QueryCtxt, rustc_middle[eb7209f5870e9fb7]::dep_graph::dep_node::DepKind>
  45:     0x7fdfb2215453 - <rustc_query_impl[3a6baddf07124ab7]::Queries as rustc_middle[eb7209f5870e9fb7]::ty::query::QueryEngine>::predicates_of
  46:     0x7fdfb1d62ee5 - rustc_hir_analysis[9174c993ab369dfd]::collect::convert_item
  47:     0x7fdfb1d5db9b - <rustc_middle[eb7209f5870e9fb7]::hir::map::Map>::visit_item_likes_in_module::<rustc_hir_analysis[9174c993ab369dfd]::collect::CollectItemTypesVisitor>
  48:     0x7fdfb1d5d9ac - rustc_hir_analysis[9174c993ab369dfd]::collect::collect_mod_item_types
  49:     0x7fdfb2b30931 - rustc_query_system[e5b40bf290de15d8]::query::plumbing::try_execute_query::<rustc_query_impl[3a6baddf07124ab7]::queries::collect_mod_item_types, rustc_query_impl[3a6baddf07124ab7]::plumbing::QueryCtxt>
  50:     0x7fdfb2f7ee5d - <rustc_query_impl[3a6baddf07124ab7]::Queries as rustc_middle[eb7209f5870e9fb7]::ty::query::QueryEngine>::collect_mod_item_types
  51:     0x7fdfb1a70fcd - <rustc_session[b580c712976fc965]::session::Session>::track_errors::<rustc_hir_analysis[9174c993ab369dfd]::check_crate::{closure#0}, ()>
  52:     0x7fdfb1a6fc4c - rustc_hir_analysis[9174c993ab369dfd]::check_crate
  53:     0x7fdfb1a6f96b - rustc_interface[3781616314f5d936]::passes::analysis
  54:     0x7fdfb2ce6a8e - rustc_query_system[e5b40bf290de15d8]::query::plumbing::try_execute_query::<rustc_query_impl[3a6baddf07124ab7]::queries::analysis, rustc_query_impl[3a6baddf07124ab7]::plumbing::QueryCtxt>
  55:     0x7fdfb2f7b7aa - <rustc_query_impl[3a6baddf07124ab7]::Queries as rustc_middle[eb7209f5870e9fb7]::ty::query::QueryEngine>::analysis
  56:     0x7fdfb27a5850 - <rustc_interface[3781616314f5d936]::passes::QueryContext>::enter::<rustc_driver[f4ad927b3c57833d]::run_compiler::{closure#1}::{closure#2}::{closure#2}, core[d16e85342ea223d9]::result::Result<(), rustc_errors[41d09747e2f98dea]::ErrorGuaranteed>>
  57:     0x7fdfb27a32c4 - rustc_span[4bb3e3ecb57f95d5]::with_source_map::<core[d16e85342ea223d9]::result::Result<(), rustc_errors[41d09747e2f98dea]::ErrorGuaranteed>, rustc_interface[3781616314f5d936]::interface::run_compiler<core[d16e85342ea223d9]::result::Result<(), rustc_errors[41d09747e2f98dea]::ErrorGuaranteed>, rustc_driver[f4ad927b3c57833d]::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
  58:     0x7fdfb279bce4 - <scoped_tls[1a6b834cb64348ef]::ScopedKey<rustc_span[4bb3e3ecb57f95d5]::SessionGlobals>>::set::<rustc_interface[3781616314f5d936]::interface::run_compiler<core[d16e85342ea223d9]::result::Result<(), rustc_errors[41d09747e2f98dea]::ErrorGuaranteed>, rustc_driver[f4ad927b3c57833d]::run_compiler::{closure#1}>::{closure#0}, core[d16e85342ea223d9]::result::Result<(), rustc_errors[41d09747e2f98dea]::ErrorGuaranteed>>
  59:     0x7fdfb279b3e2 - std[3da461b304582a2c]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[3781616314f5d936]::util::run_in_thread_pool_with_globals<rustc_interface[3781616314f5d936]::interface::run_compiler<core[d16e85342ea223d9]::result::Result<(), rustc_errors[41d09747e2f98dea]::ErrorGuaranteed>, rustc_driver[f4ad927b3c57833d]::run_compiler::{closure#1}>::{closure#0}, core[d16e85342ea223d9]::result::Result<(), rustc_errors[41d09747e2f98dea]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[d16e85342ea223d9]::result::Result<(), rustc_errors[41d09747e2f98dea]::ErrorGuaranteed>>
  60:     0x7fdfb279b18a - <<std[3da461b304582a2c]::thread::Builder>::spawn_unchecked_<rustc_interface[3781616314f5d936]::util::run_in_thread_pool_with_globals<rustc_interface[3781616314f5d936]::interface::run_compiler<core[d16e85342ea223d9]::result::Result<(), rustc_errors[41d09747e2f98dea]::ErrorGuaranteed>, rustc_driver[f4ad927b3c57833d]::run_compiler::{closure#1}>::{closure#0}, core[d16e85342ea223d9]::result::Result<(), rustc_errors[41d09747e2f98dea]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[d16e85342ea223d9]::result::Result<(), rustc_errors[41d09747e2f98dea]::ErrorGuaranteed>>::{closure#1} as core[d16e85342ea223d9]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  61:     0x7fdfb0283823 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h1c0f3664d7ced314
                               at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/alloc/src/boxed.rs:1988:9
  62:     0x7fdfb0283823 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h67647c21c6c4968a
                               at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/alloc/src/boxed.rs:1988:9
  63:     0x7fdfb0283823 - std::sys::unix::thread::Thread::new::thread_start::h355d348ba593a22c
                               at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/std/src/sys/unix/thread.rs:108:17
  64:     0x7fdfb0146609 - start_thread
  65:     0x7fdfb0069133 - clone
  66:                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.68.0 (2c8cc3432 2023-03-06) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type lib -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 [explicit_predicates_of] computing explicit predicates of `<impl at src/lib.rs:2:1: 2:21>`
#1 [predicates_defined_on] computing predicates of `<impl at src/lib.rs:2:1: 2:21>`
#2 [predicates_of] computing predicates of `<impl at src/lib.rs:2:1: 2:21>`
#3 [collect_mod_item_types] collecting item types in top-level module
#4 [analysis] running analysis passes on this crate
end of query stack
error: could not compile `playground`

@MMukundi MMukundi 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 Mar 16, 2023
@fmease
Copy link
Member

fmease commented Mar 16, 2023

This bug only exists on stable. Based on what happens in a successful run on nightly

If something crashes on stable but not on nightly, this generally means that underlying bug has already been fixed (on nightly) and that the fix will arrive on stable roughly 12 weeks later.

In this case this issue is a duplicate of #108562 which was fixed in #108575. The fix is part of 1.69 (current beta) which is going to become stable on April 20, 2023 UTC (see https://forge.rust-lang.org/).

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

3 participants