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

Region parameter out of range when substituting in region #102751

Closed
dwrensha opened this issue Oct 6, 2022 · 2 comments · Fixed by #102845
Closed

Region parameter out of range when substituting in region #102751

dwrensha opened this issue Oct 6, 2022 · 2 comments · Fixed by #102845
Assignees
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

@dwrensha
Copy link
Contributor

dwrensha commented Oct 6, 2022

rustc crashes on the following input, found by fuzz_rustc:

trait GatTrait{ type Gat<'a> where f: 'a; }

trait SuperTrait<T>: GatTrait<Gat<'a>=T> {
    fn c(&self) -> dyn SuperTrait<T>;
}
error[E0261]: use of undeclared lifetime name `'a`
 --> bug.rs:3:35
  |
3 | trait SuperTrait<T>: GatTrait<Gat<'a>=T> {
  |                                   ^^ undeclared lifetime
  |
  = note: for more information on higher-ranked polymorphism, visit https://doc.rust-lang.org/nomicon/hrtb.html
help: consider making the bound lifetime-generic with a new `'a` lifetime
  |
3 | trait SuperTrait<T>: for<'a> GatTrait<Gat<'a>=T> {
  |                      +++++++
help: consider introducing lifetime `'a` here
  |
3 | trait SuperTrait<'a, T>: GatTrait<Gat<'a>=T> {
  |                  +++

error[E0412]: cannot find type `f` in this scope
 --> bug.rs:1:36
  |
1 | trait GatTrait{ type Gat<'a> where f: 'a; }
  |                                    ^ not found in this scope

error[E0601]: `main` function not found in crate `bug`
 --> bug.rs:5:2
  |
5 | }
  |  ^ consider adding a `main` function to `bug.rs`

error: internal compiler error: compiler/rustc_middle/src/ty/subst.rs:610:13: Region parameter out of range when substituting in region 'a (index=1)

thread 'rustc' panicked at 'Box<dyn Any>', /rustc/c97d02cdb5ca5f5e9eff1fa9e4560d220d1fd2a0/compiler/rustc_errors/src/lib.rs:1502:9
stack backtrace:
   0:     0x7f5eb056e450 - std::backtrace_rs::backtrace::libunwind::trace::he4f7ac5ff70ace92
                               at /rustc/c97d02cdb5ca5f5e9eff1fa9e4560d220d1fd2a0/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   1:     0x7f5eb056e450 - std::backtrace_rs::backtrace::trace_unsynchronized::h44946fc5117c0ed2
                               at /rustc/c97d02cdb5ca5f5e9eff1fa9e4560d220d1fd2a0/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f5eb056e450 - std::sys_common::backtrace::_print_fmt::h28f6faa1922d109d
                               at /rustc/c97d02cdb5ca5f5e9eff1fa9e4560d220d1fd2a0/library/std/src/sys_common/backtrace.rs:66:5
   3:     0x7f5eb056e450 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h67a3af6b587781f7
                               at /rustc/c97d02cdb5ca5f5e9eff1fa9e4560d220d1fd2a0/library/std/src/sys_common/backtrace.rs:45:22
   4:     0x7f5eb05c921e - core::fmt::write::he0433a21d30ac2a9
                               at /rustc/c97d02cdb5ca5f5e9eff1fa9e4560d220d1fd2a0/library/core/src/fmt/mod.rs:1209:17
   5:     0x7f5eb055f0d5 - std::io::Write::write_fmt::heea2816ff0763614
                               at /rustc/c97d02cdb5ca5f5e9eff1fa9e4560d220d1fd2a0/library/std/src/io/mod.rs:1679:15
   6:     0x7f5eb05711f3 - std::sys_common::backtrace::_print::hbe8fc7edd12cd64b
                               at /rustc/c97d02cdb5ca5f5e9eff1fa9e4560d220d1fd2a0/library/std/src/sys_common/backtrace.rs:48:5
   7:     0x7f5eb05711f3 - std::sys_common::backtrace::print::h5ddb4c29a6ef3973
                               at /rustc/c97d02cdb5ca5f5e9eff1fa9e4560d220d1fd2a0/library/std/src/sys_common/backtrace.rs:35:9
   8:     0x7f5eb05711f3 - std::panicking::default_hook::{{closure}}::h65b9ed194bc4a144
                               at /rustc/c97d02cdb5ca5f5e9eff1fa9e4560d220d1fd2a0/library/std/src/panicking.rs:267:22
   9:     0x7f5eb0570eca - std::panicking::default_hook::h905b9f0ff6b3810b
                               at /rustc/c97d02cdb5ca5f5e9eff1fa9e4560d220d1fd2a0/library/std/src/panicking.rs:286:9
  10:     0x7f5eb2e89321 - rustc_driver[9f74c97b2f49ff6d]::DEFAULT_HOOK::{closure#0}::{closure#0}
  11:     0x7f5eb0571a2b - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h4dc0a6665de086cb
                               at /rustc/c97d02cdb5ca5f5e9eff1fa9e4560d220d1fd2a0/library/alloc/src/boxed.rs:1952:9
  12:     0x7f5eb0571a2b - std::panicking::rust_panic_with_hook::h1f7cfdc651434583
                               at /rustc/c97d02cdb5ca5f5e9eff1fa9e4560d220d1fd2a0/library/std/src/panicking.rs:673:13
  13:     0x7f5eb3e828e1 - std[593a3d82be71d5e]::panicking::begin_panic::<rustc_errors[8ac32f63f2ebd6a9]::ExplicitBug>::{closure#0}
  14:     0x7f5eb3e7e736 - std[593a3d82be71d5e]::sys_common::backtrace::__rust_end_short_backtrace::<std[593a3d82be71d5e]::panicking::begin_panic<rustc_errors[8ac32f63f2ebd6a9]::ExplicitBug>::{closure#0}, !>
  15:     0x7f5eb3e7e6d6 - std[593a3d82be71d5e]::panicking::begin_panic::<rustc_errors[8ac32f63f2ebd6a9]::ExplicitBug>
  16:     0x7f5eb3e7e6c6 - std[593a3d82be71d5e]::panic::panic_any::<rustc_errors[8ac32f63f2ebd6a9]::ExplicitBug>
  17:     0x7f5eb3e79faf - <rustc_errors[8ac32f63f2ebd6a9]::HandlerInner>::bug::<&alloc[d4e408da29048df8]::string::String>
  18:     0x7f5eb3e79ae0 - <rustc_errors[8ac32f63f2ebd6a9]::Handler>::bug::<&alloc[d4e408da29048df8]::string::String>
  19:     0x7f5eb3ebf70d - rustc_middle[3cb849b186336456]::ty::context::tls::with_context_opt::<rustc_middle[3cb849b186336456]::ty::context::tls::with_opt<rustc_middle[3cb849b186336456]::util::bug::opt_span_bug_fmt<rustc_span[e4e986023a03f235]::span_encoding::Span>::{closure#0}, ()>::{closure#0}, ()>
  20:     0x7f5eb3ec0576 - rustc_middle[3cb849b186336456]::util::bug::opt_span_bug_fmt::<rustc_span[e4e986023a03f235]::span_encoding::Span>
  21:     0x7f5eb185b2d3 - rustc_middle[3cb849b186336456]::util::bug::bug_fmt
  22:     0x7f5eb3eef356 - <rustc_middle[3cb849b186336456]::ty::subst::SubstFolder as rustc_middle[3cb849b186336456]::ty::fold::TypeFolder>::fold_region::region_param_out_of_range
  23:     0x7f5eb28d9084 - <rustc_middle[3cb849b186336456]::ty::subst::EarlyBinder<rustc_middle[3cb849b186336456]::ty::Predicate>>::subst
  24:     0x7f5eb183c02c - <rustc_middle[3cb849b186336456]::ty::generics::GenericPredicates>::instantiate_own
  25:     0x7f5eb1868553 - rustc_trait_selection[b9d8f0d33b5bdb27]::traits::project::confirm_param_env_candidate
  26:     0x7f5eb183399b - rustc_trait_selection[b9d8f0d33b5bdb27]::traits::project::opt_normalize_projection_type
  27:     0x7f5eb275fe85 - rustc_trait_selection[b9d8f0d33b5bdb27]::traits::project::normalize_projection_type
  28:     0x7f5eb275eefe - <rustc_infer[1d5e292c5ab4e233]::infer::InferCtxtBuilder as rustc_trait_selection[b9d8f0d33b5bdb27]::infer::InferCtxtBuilderExt>::enter_canonical_trait_query::<rustc_middle[3cb849b186336456]::ty::ParamEnvAnd<rustc_middle[3cb849b186336456]::ty::sty::ProjectionTy>, rustc_middle[3cb849b186336456]::traits::query::NormalizationResult, rustc_traits[d3608d2900f09bbc]::normalize_projection_ty::normalize_projection_ty::{closure#0}>
  29:     0x7f5eb275e725 - rustc_traits[d3608d2900f09bbc]::normalize_projection_ty::normalize_projection_ty
  30:     0x7f5eb270b9d4 - rustc_query_system[2616d53ea6c58ce8]::query::plumbing::try_execute_query::<rustc_query_impl[6d22189f857dd0a5]::plumbing::QueryCtxt, rustc_query_system[2616d53ea6c58ce8]::query::caches::DefaultCache<rustc_middle[3cb849b186336456]::infer::canonical::Canonical<rustc_middle[3cb849b186336456]::ty::ParamEnvAnd<rustc_middle[3cb849b186336456]::ty::sty::ProjectionTy>>, core[8a001a5c204cfc72]::result::Result<&rustc_middle[3cb849b186336456]::infer::canonical::Canonical<rustc_middle[3cb849b186336456]::infer::canonical::QueryResponse<rustc_middle[3cb849b186336456]::traits::query::NormalizationResult>>, rustc_middle[3cb849b186336456]::traits::query::NoSolution>>>
  31:     0x7f5eb2d8b367 - <rustc_query_impl[6d22189f857dd0a5]::Queries as rustc_middle[3cb849b186336456]::ty::query::QueryEngine>::normalize_projection_ty
  32:     0x7f5eb20ac581 - <rustc_trait_selection[b9d8f0d33b5bdb27]::traits::query::normalize::QueryNormalizer as rustc_middle[3cb849b186336456]::ty::fold::FallibleTypeFolder>::try_fold_ty
  33:     0x7f5eb294b293 - <rustc_middle[3cb849b186336456]::ty::sty::Binder<rustc_middle[3cb849b186336456]::ty::sty::ExistentialPredicate> as rustc_middle[3cb849b186336456]::ty::fold::TypeSuperFoldable>::try_super_fold_with::<rustc_trait_selection[b9d8f0d33b5bdb27]::traits::query::normalize::QueryNormalizer>
  34:     0x7f5eb20b5627 - rustc_middle[3cb849b186336456]::ty::util::fold_list::<rustc_trait_selection[b9d8f0d33b5bdb27]::traits::query::normalize::QueryNormalizer, rustc_middle[3cb849b186336456]::ty::sty::Binder<rustc_middle[3cb849b186336456]::ty::sty::ExistentialPredicate>, <&rustc_middle[3cb849b186336456]::ty::list::List<rustc_middle[3cb849b186336456]::ty::sty::Binder<rustc_middle[3cb849b186336456]::ty::sty::ExistentialPredicate>> as rustc_middle[3cb849b186336456]::ty::fold::TypeFoldable>::try_fold_with<rustc_trait_selection[b9d8f0d33b5bdb27]::traits::query::normalize::QueryNormalizer>::{closure#0}>
  35:     0x7f5eb20ae288 - <rustc_middle[3cb849b186336456]::ty::Ty as rustc_middle[3cb849b186336456]::ty::fold::TypeSuperFoldable>::try_super_fold_with::<rustc_trait_selection[b9d8f0d33b5bdb27]::traits::query::normalize::QueryNormalizer>
  36:     0x7f5eb20ac18c - <rustc_trait_selection[b9d8f0d33b5bdb27]::traits::query::normalize::QueryNormalizer as rustc_middle[3cb849b186336456]::ty::fold::FallibleTypeFolder>::try_fold_ty
  37:     0x7f5eb20addc8 - <rustc_middle[3cb849b186336456]::ty::Ty as rustc_middle[3cb849b186336456]::ty::fold::TypeSuperFoldable>::try_super_fold_with::<rustc_trait_selection[b9d8f0d33b5bdb27]::traits::query::normalize::QueryNormalizer>
  38:     0x7f5eb20ac18c - <rustc_trait_selection[b9d8f0d33b5bdb27]::traits::query::normalize::QueryNormalizer as rustc_middle[3cb849b186336456]::ty::fold::FallibleTypeFolder>::try_fold_ty
  39:     0x7f5eb18a0505 - <rustc_infer[1d5e292c5ab4e233]::infer::InferCtxtBuilder>::enter::<core[8a001a5c204cfc72]::result::Result<rustc_middle[3cb849b186336456]::ty::subst::GenericArg, rustc_middle[3cb849b186336456]::traits::query::NoSolution>, rustc_traits[d3608d2900f09bbc]::normalize_erasing_regions::try_normalize_after_erasing_regions<rustc_middle[3cb849b186336456]::ty::subst::GenericArg>::{closure#0}>
  40:     0x7f5eb189feec - <rustc_traits[d3608d2900f09bbc]::normalize_erasing_regions::provide::{closure#0} as core[8a001a5c204cfc72]::ops::function::FnOnce<(rustc_middle[3cb849b186336456]::ty::context::TyCtxt, rustc_middle[3cb849b186336456]::ty::ParamEnvAnd<rustc_middle[3cb849b186336456]::ty::subst::GenericArg>)>>::call_once
  41:     0x7f5eb2662a2a - rustc_query_system[2616d53ea6c58ce8]::query::plumbing::try_execute_query::<rustc_query_impl[6d22189f857dd0a5]::plumbing::QueryCtxt, rustc_query_system[2616d53ea6c58ce8]::query::caches::DefaultCache<rustc_middle[3cb849b186336456]::ty::ParamEnvAnd<rustc_middle[3cb849b186336456]::ty::subst::GenericArg>, core[8a001a5c204cfc72]::result::Result<rustc_middle[3cb849b186336456]::ty::subst::GenericArg, rustc_middle[3cb849b186336456]::traits::query::NoSolution>>>
  42:     0x7f5eb2d8b4a2 - <rustc_query_impl[6d22189f857dd0a5]::Queries as rustc_middle[3cb849b186336456]::ty::query::QueryEngine>::try_normalize_generic_arg_after_erasing_regions
  43:     0x7f5eb17af4c2 - <rustc_middle[3cb849b186336456]::ty::normalize_erasing_regions::TryNormalizeAfterErasingRegionsFolder as rustc_middle[3cb849b186336456]::ty::fold::FallibleTypeFolder>::try_fold_ty
  44:     0x7f5eb247fe1a - rustc_ty_utils[b546c34da58796f6]::layout::layout_of
  45:     0x7f5eb2370fa0 - rustc_query_system[2616d53ea6c58ce8]::query::plumbing::get_query::<rustc_query_impl[6d22189f857dd0a5]::queries::layout_of, rustc_query_impl[6d22189f857dd0a5]::plumbing::QueryCtxt>
  46:     0x7f5eb2370bb3 - <rustc_query_impl[6d22189f857dd0a5]::Queries as rustc_middle[3cb849b186336456]::ty::query::QueryEngine>::layout_of
  47:     0x7f5eb2974605 - rustc_trait_selection[b9d8f0d33b5bdb27]::traits::object_safety::virtual_call_violation_for_method::{closure#2}
  48:     0x7f5eb297183e - rustc_trait_selection[b9d8f0d33b5bdb27]::traits::object_safety::virtual_call_violation_for_method
  49:     0x7f5eb2b3d3e7 - <core[8a001a5c204cfc72]::iter::adapters::map::Map<core[8a001a5c204cfc72]::iter::adapters::map::Map<core[8a001a5c204cfc72]::slice::iter::Iter<(rustc_span[e4e986023a03f235]::symbol::Symbol, &rustc_middle[3cb849b186336456]::ty::assoc::AssocItem)>, <rustc_data_structures[a6ef56eefc67b509]::sorted_map::index_map::SortedIndexMultiMap<u32, rustc_span[e4e986023a03f235]::symbol::Symbol, &rustc_middle[3cb849b186336456]::ty::assoc::AssocItem>>::iter::{closure#0}>, <rustc_middle[3cb849b186336456]::ty::assoc::AssocItems>::in_definition_order::{closure#0}> as core[8a001a5c204cfc72]::iter::traits::iterator::Iterator>::try_fold::<(), core[8a001a5c204cfc72]::iter::adapters::filter::filter_try_fold<&rustc_middle[3cb849b186336456]::ty::assoc::AssocItem, (), core[8a001a5c204cfc72]::ops::control_flow::ControlFlow<rustc_middle[3cb849b186336456]::traits::ObjectSafetyViolation>, rustc_trait_selection[b9d8f0d33b5bdb27]::traits::object_safety::object_safety_violations_for_trait::{closure#0}, core[8a001a5c204cfc72]::iter::adapters::filter_map::filter_map_try_fold<&rustc_middle[3cb849b186336456]::ty::assoc::AssocItem, rustc_middle[3cb849b186336456]::traits::ObjectSafetyViolation, (), core[8a001a5c204cfc72]::ops::control_flow::ControlFlow<rustc_middle[3cb849b186336456]::traits::ObjectSafetyViolation>, rustc_trait_selection[b9d8f0d33b5bdb27]::traits::object_safety::object_safety_violations_for_trait::{closure#1}, core[8a001a5c204cfc72]::iter::traits::iterator::Iterator::find::check<rustc_middle[3cb849b186336456]::traits::ObjectSafetyViolation, &mut rustc_trait_selection[b9d8f0d33b5bdb27]::traits::object_safety::object_safety_violations_for_trait::{closure#2}>::{closure#0}>::{closure#0}>::{closure#0}, core[8a001a5c204cfc72]::ops::control_flow::ControlFlow<rustc_middle[3cb849b186336456]::traits::ObjectSafetyViolation>>
  50:     0x7f5eb2b3cef5 - <alloc[d4e408da29048df8]::vec::Vec<rustc_middle[3cb849b186336456]::traits::ObjectSafetyViolation> as alloc[d4e408da29048df8]::vec::spec_from_iter::SpecFromIter<rustc_middle[3cb849b186336456]::traits::ObjectSafetyViolation, core[8a001a5c204cfc72]::iter::adapters::filter::Filter<core[8a001a5c204cfc72]::iter::adapters::filter_map::FilterMap<core[8a001a5c204cfc72]::iter::adapters::filter::Filter<core[8a001a5c204cfc72]::iter::adapters::map::Map<core[8a001a5c204cfc72]::iter::adapters::map::Map<core[8a001a5c204cfc72]::slice::iter::Iter<(rustc_span[e4e986023a03f235]::symbol::Symbol, &rustc_middle[3cb849b186336456]::ty::assoc::AssocItem)>, <rustc_data_structures[a6ef56eefc67b509]::sorted_map::index_map::SortedIndexMultiMap<u32, rustc_span[e4e986023a03f235]::symbol::Symbol, &rustc_middle[3cb849b186336456]::ty::assoc::AssocItem>>::iter::{closure#0}>, <rustc_middle[3cb849b186336456]::ty::assoc::AssocItems>::in_definition_order::{closure#0}>, rustc_trait_selection[b9d8f0d33b5bdb27]::traits::object_safety::object_safety_violations_for_trait::{closure#0}>, rustc_trait_selection[b9d8f0d33b5bdb27]::traits::object_safety::object_safety_violations_for_trait::{closure#1}>, rustc_trait_selection[b9d8f0d33b5bdb27]::traits::object_safety::object_safety_violations_for_trait::{closure#2}>>>::from_iter
  51:     0x7f5eb2b3c12e - <&mut rustc_trait_selection[b9d8f0d33b5bdb27]::traits::object_safety::object_safety_violations::{closure#0} as core[8a001a5c204cfc72]::ops::function::FnOnce<(rustc_span[e4e986023a03f235]::def_id::DefId,)>>::call_once
  52:     0x7f5eb2b3bd5e - <core[8a001a5c204cfc72]::iter::adapters::flatten::FlatMap<rustc_trait_selection[b9d8f0d33b5bdb27]::traits::util::SupertraitDefIds, alloc[d4e408da29048df8]::vec::Vec<rustc_middle[3cb849b186336456]::traits::ObjectSafetyViolation>, rustc_trait_selection[b9d8f0d33b5bdb27]::traits::object_safety::object_safety_violations::{closure#0}> as core[8a001a5c204cfc72]::iter::traits::iterator::Iterator>::next
  53:     0x7f5eb2b3b79c - <smallvec[a6cfff874b6c25d4]::SmallVec<[rustc_middle[3cb849b186336456]::traits::ObjectSafetyViolation; 8usize]> as core[8a001a5c204cfc72]::iter::traits::collect::Extend<rustc_middle[3cb849b186336456]::traits::ObjectSafetyViolation>>::extend::<core[8a001a5c204cfc72]::iter::adapters::flatten::FlatMap<rustc_trait_selection[b9d8f0d33b5bdb27]::traits::util::SupertraitDefIds, alloc[d4e408da29048df8]::vec::Vec<rustc_middle[3cb849b186336456]::traits::ObjectSafetyViolation>, rustc_trait_selection[b9d8f0d33b5bdb27]::traits::object_safety::object_safety_violations::{closure#0}>>
  54:     0x7f5eb2b3b551 - <rustc_middle[3cb849b186336456]::arena::Arena>::alloc_from_iter::<rustc_middle[3cb849b186336456]::traits::ObjectSafetyViolation, rustc_arena[72ebc1f000229779]::IsNotCopy, core[8a001a5c204cfc72]::iter::adapters::flatten::FlatMap<rustc_trait_selection[b9d8f0d33b5bdb27]::traits::util::SupertraitDefIds, alloc[d4e408da29048df8]::vec::Vec<rustc_middle[3cb849b186336456]::traits::ObjectSafetyViolation>, rustc_trait_selection[b9d8f0d33b5bdb27]::traits::object_safety::object_safety_violations::{closure#0}>>
  55:     0x7f5eb2b3b503 - rustc_trait_selection[b9d8f0d33b5bdb27]::traits::object_safety::object_safety_violations
  56:     0x7f5eb2bff173 - rustc_query_system[2616d53ea6c58ce8]::query::plumbing::try_execute_query::<rustc_query_impl[6d22189f857dd0a5]::plumbing::QueryCtxt, rustc_query_system[2616d53ea6c58ce8]::query::caches::DefaultCache<rustc_span[e4e986023a03f235]::def_id::DefId, &[rustc_middle[3cb849b186336456]::traits::ObjectSafetyViolation]>>
  57:     0x7f5eb2bfedd6 - rustc_query_system[2616d53ea6c58ce8]::query::plumbing::get_query::<rustc_query_impl[6d22189f857dd0a5]::queries::object_safety_violations, rustc_query_impl[6d22189f857dd0a5]::plumbing::QueryCtxt>
  58:     0x7f5eb26268a1 - rustc_hir_analysis[629d6fb7996b2087]::check::wfcheck::check_well_formed
  59:     0x7f5eb1e53bdf - rustc_query_system[2616d53ea6c58ce8]::query::plumbing::get_query::<rustc_query_impl[6d22189f857dd0a5]::queries::check_well_formed, rustc_query_impl[6d22189f857dd0a5]::plumbing::QueryCtxt>
  60:     0x7f5eb27be8a8 - rustc_data_structures[a6ef56eefc67b509]::sync::par_for_each_in::<&[rustc_hir[bd8a682947eb469d]::hir::TraitItemId], <rustc_middle[3cb849b186336456]::hir::ModuleItems>::par_trait_items<rustc_hir_analysis[629d6fb7996b2087]::check::wfcheck::check_mod_type_wf::{closure#2}>::{closure#0}>
  61:     0x7f5eb2cc6c41 - rustc_hir_analysis[629d6fb7996b2087]::check::wfcheck::check_mod_type_wf
  62:     0x7f5eb2550f48 - rustc_query_system[2616d53ea6c58ce8]::query::plumbing::try_execute_query::<rustc_query_impl[6d22189f857dd0a5]::plumbing::QueryCtxt, rustc_query_system[2616d53ea6c58ce8]::query::caches::DefaultCache<rustc_span[e4e986023a03f235]::def_id::LocalDefId, ()>>
  63:     0x7f5eb28a6289 - rustc_query_system[2616d53ea6c58ce8]::query::plumbing::get_query::<rustc_query_impl[6d22189f857dd0a5]::queries::check_mod_type_wf, rustc_query_impl[6d22189f857dd0a5]::plumbing::QueryCtxt>
  64:     0x7f5eb21f64c8 - rustc_data_structures[a6ef56eefc67b509]::sync::par_for_each_in::<&[rustc_hir[bd8a682947eb469d]::hir_id::OwnerId], <rustc_middle[3cb849b186336456]::hir::map::Map>::par_for_each_module<rustc_hir_analysis[629d6fb7996b2087]::check_crate::{closure#5}::{closure#0}::{closure#0}>::{closure#0}>
  65:     0x7f5eb21f62d3 - <rustc_session[4a55645a1cc8e5aa]::session::Session>::track_errors::<rustc_hir_analysis[629d6fb7996b2087]::check_crate::{closure#5}, ()>
  66:     0x7f5eb21f5a50 - rustc_hir_analysis[629d6fb7996b2087]::check_crate
  67:     0x7f5eb21f5777 - rustc_interface[65a66cb79c7b1b93]::passes::analysis
  68:     0x7f5eb2bfbd94 - rustc_query_system[2616d53ea6c58ce8]::query::plumbing::try_execute_query::<rustc_query_impl[6d22189f857dd0a5]::plumbing::QueryCtxt, rustc_query_system[2616d53ea6c58ce8]::query::caches::DefaultCache<(), core[8a001a5c204cfc72]::result::Result<(), rustc_errors[8ac32f63f2ebd6a9]::ErrorGuaranteed>>>
  69:     0x7f5eb2bfbac7 - rustc_query_system[2616d53ea6c58ce8]::query::plumbing::get_query::<rustc_query_impl[6d22189f857dd0a5]::queries::analysis, rustc_query_impl[6d22189f857dd0a5]::plumbing::QueryCtxt>
  70:     0x7f5eb1b641c4 - <rustc_interface[65a66cb79c7b1b93]::passes::QueryContext>::enter::<rustc_driver[9f74c97b2f49ff6d]::run_compiler::{closure#1}::{closure#2}::{closure#3}, core[8a001a5c204cfc72]::result::Result<(), rustc_errors[8ac32f63f2ebd6a9]::ErrorGuaranteed>>
  71:     0x7f5eb1b5ed59 - rustc_interface[65a66cb79c7b1b93]::interface::create_compiler_and_run::<core[8a001a5c204cfc72]::result::Result<(), rustc_errors[8ac32f63f2ebd6a9]::ErrorGuaranteed>, rustc_driver[9f74c97b2f49ff6d]::run_compiler::{closure#1}>
  72:     0x7f5eb1b5d662 - <scoped_tls[3258fef5e1ce8117]::ScopedKey<rustc_span[e4e986023a03f235]::SessionGlobals>>::set::<rustc_interface[65a66cb79c7b1b93]::interface::run_compiler<core[8a001a5c204cfc72]::result::Result<(), rustc_errors[8ac32f63f2ebd6a9]::ErrorGuaranteed>, rustc_driver[9f74c97b2f49ff6d]::run_compiler::{closure#1}>::{closure#0}, core[8a001a5c204cfc72]::result::Result<(), rustc_errors[8ac32f63f2ebd6a9]::ErrorGuaranteed>>
  73:     0x7f5eb1b5d34f - std[593a3d82be71d5e]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[65a66cb79c7b1b93]::util::run_in_thread_pool_with_globals<rustc_interface[65a66cb79c7b1b93]::interface::run_compiler<core[8a001a5c204cfc72]::result::Result<(), rustc_errors[8ac32f63f2ebd6a9]::ErrorGuaranteed>, rustc_driver[9f74c97b2f49ff6d]::run_compiler::{closure#1}>::{closure#0}, core[8a001a5c204cfc72]::result::Result<(), rustc_errors[8ac32f63f2ebd6a9]::ErrorGuaranteed>>::{closure#0}, core[8a001a5c204cfc72]::result::Result<(), rustc_errors[8ac32f63f2ebd6a9]::ErrorGuaranteed>>
  74:     0x7f5eb2c9dfc0 - <<std[593a3d82be71d5e]::thread::Builder>::spawn_unchecked_<rustc_interface[65a66cb79c7b1b93]::util::run_in_thread_pool_with_globals<rustc_interface[65a66cb79c7b1b93]::interface::run_compiler<core[8a001a5c204cfc72]::result::Result<(), rustc_errors[8ac32f63f2ebd6a9]::ErrorGuaranteed>, rustc_driver[9f74c97b2f49ff6d]::run_compiler::{closure#1}>::{closure#0}, core[8a001a5c204cfc72]::result::Result<(), rustc_errors[8ac32f63f2ebd6a9]::ErrorGuaranteed>>::{closure#0}, core[8a001a5c204cfc72]::result::Result<(), rustc_errors[8ac32f63f2ebd6a9]::ErrorGuaranteed>>::{closure#1} as core[8a001a5c204cfc72]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  75:     0x7f5eb057b503 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h7f4c98e4ab37639c
                               at /rustc/c97d02cdb5ca5f5e9eff1fa9e4560d220d1fd2a0/library/alloc/src/boxed.rs:1938:9
  76:     0x7f5eb057b503 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hcbf5a56919cdb481
                               at /rustc/c97d02cdb5ca5f5e9eff1fa9e4560d220d1fd2a0/library/alloc/src/boxed.rs:1938:9
  77:     0x7f5eb057b503 - std::sys::unix::thread::Thread::new::thread_start::hb0958d041d459db7
                               at /rustc/c97d02cdb5ca5f5e9eff1fa9e4560d220d1fd2a0/library/std/src/sys/unix/thread.rs:108:17
  78:     0x7f5eb0294b43 - start_thread
                               at ./nptl/./nptl/pthread_create.c:442:8
  79:     0x7f5eb0326a00 - clone3
                               at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
  80:                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-nightly (c97d02cdb 2022-10-05) running on x86_64-unknown-linux-gnu

query stack during panic:
#0 [normalize_projection_ty] normalizing `Canonical { max_universe: U0, variables: [], value: ParamEnvAnd { param_env: ParamEnv { caller_bounds: [Binder(TraitPredicate(<Self as SuperTrait<T>>, polarity:Positive), []), Binder(TraitPredicate(<T as core::marker::Sized>, polarity:Positive), []), Binder(ProjectionPredicate(ProjectionTy { substs: [Self, ReStatic], item_def_id: DefId(0:4 ~ bug[00d1]::GatTrait::Gat) }, Term::Ty(T)), []), Binder(TraitPredicate(<Self as GatTrait>, polarity:Positive), [])], reveal: All, constness: NotConst }, value: ProjectionTy { substs: [Self], item_def_id: DefId(0:4 ~ bug[00d1]::GatTrait::Gat) } } }`
#1 [try_normalize_generic_arg_after_erasing_regions] normalizing `&dyn SuperTrait<T, Gat = <Self as GatTrait>::Gat>`
#2 [layout_of] computing layout of `&(dyn SuperTrait<T, Gat = <Self as GatTrait>::Gat> + 'static)`
#3 [object_safety_violations] determine object safety of trait `SuperTrait`
#4 [check_well_formed] checking that `SuperTrait::c` is well-formed
#5 [check_mod_type_wf] checking that types are well-formed in top-level module
#6 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to 4 previous errors

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

@dwrensha dwrensha 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 Oct 6, 2022
@dwrensha
Copy link
Contributor Author

dwrensha commented Oct 6, 2022

cargo-bisect-rustc output:

searched toolchains nightly-2021-02-10 through nightly-2022-10-05


Regression in nightly-2022-04-18


found 10 bors merge commits in the specified range
commit[0] 2022-04-16UTC: Auto merge of #96123 - Dylan-DPC:rollup-qjog6n1, r=Dylan-DPC
commit[1] 2022-04-16UTC: Auto merge of #95899 - petrochenkov:modchild2, r=cjgillot
commit[2] 2022-04-17UTC: Auto merge of #96134 - Dylan-DPC:rollup-ejug3yq, r=Dylan-DPC
commit[3] 2022-04-17UTC: Auto merge of #96002 - nnethercote:speed-up-Vec-clear-2, r=m-ou-se
commit[4] 2022-04-17UTC: Auto merge of #96010 - eduardosm:Unique-on-top-of-NonNull, r=m-ou-se,tmiasko
commit[5] 2022-04-17UTC: Auto merge of #95655 - kckeiks:create-hir-crate-items-query, r=cjgillot
commit[6] 2022-04-17UTC: Auto merge of #96016 - Aaron1011:hash-name-cleanup, r=cjgillot
commit[7] 2022-04-17UTC: Auto merge of #95779 - cjgillot:ast-lifetimes-undeclared, r=petrochenkov
commit[8] 2022-04-17UTC: Auto merge of #96091 - GuillaumeGomez:duplicated-blanket-impls, r=notriddle
commit[9] 2022-04-17UTC: Auto merge of #96139 - erikdesjardins:revertinl2, r=Mark-Simulacrum

@dwrensha
Copy link
Contributor Author

dwrensha commented Oct 6, 2022

This regressed in #95779, specifically in fc9f255.
cc @cjgillot

@cjgillot cjgillot self-assigned this Oct 6, 2022
JohnTitor added a commit to JohnTitor/rust that referenced this issue Oct 10, 2022
Elaborate trait ref to compute object safety.

instead of building them manually from supertraits and associated items.

This allows to have the correct substs for GATs.

Fixes rust-lang#102751
@bors bors closed this as completed in a4e5577 Oct 10, 2022
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

Successfully merging a pull request may close this issue.

2 participants