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

internal compiler error: GAT with ambiguous associated type #109897

Closed
Altair-Bueno opened this issue Apr 3, 2023 · 2 comments
Closed

internal compiler error: GAT with ambiguous associated type #109897

Altair-Bueno opened this issue Apr 3, 2023 · 2 comments
Labels
C-bug Category: This is a bug. E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been 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.

Comments

@Altair-Bueno
Copy link

Code

https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=8705289202719c218836a9ec5a539fde

pub struct All<V>(pub V);

impl<I, V> Validator<I> for All<V>
where
    for<'iter> &'iter I: IntoIterator,
    I: 'static,
    V: for<'iter> Validator<<&'iter I>::Item>,
{
    type Error<'a> = V::Error<'a> where V: 'a ;

    fn validate<'a, 'b>(&'a self, value: &'b I) -> Result<(), Self::Error<'a>> {
        for x in value {
            self.0.validate(&x)?;
        }
        Ok(())
    }
}

pub trait Validator<T> {
    type Error<'a>
    where
        Self: 'a;
    fn validate<'a, 'b>(&'a self, value: &'b T) -> Result<(), Self::Error<'a>>;
}

Meta

rustc --version --verbose:

# Crashes with error described above
rustc 1.68.2 (9eb3afe9e 2023-03-27)
binary: rustc
commit-hash: 9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0
commit-date: 2023-03-27
host: x86_64-apple-darwin
release: 1.68.2
LLVM version: 15.0.6

# Nightly doesn't crash
rustc 1.70.0-nightly (0599b6b93 2023-04-01)
binary: rustc
commit-hash: 0599b6b931816ab46ab79072189075f543931cbd
commit-date: 2023-04-01
host: x86_64-apple-darwin
release: 1.70.0-nightly
LLVM version: 16.0.0
error[E0223]: ambiguous associated type
 --> verifyr/src/validators/all.rs:9:29
  |
9 |     V: for<'iter> Validator<<&'iter I>::Item>,
  |                             ^^^^^^^^^^^^^^^^ help: use the fully-qualified path: `<&'iter I as IntoIterator>::Item`

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

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:22 ~ verifyr[d95f]::validators::all::{impl#0}::'iter#1), 'iter) })

thread 'rustc' panicked at 'Box<dyn Any>', /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0/compiler/rustc_errors/src/lib.rs:987:33
stack backtrace:
   0:        0x1062c16e6 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h47bed05ceb7970ee
   1:        0x10631efca - core::fmt::write::hefd823d99333384a
   2:        0x1062b3eac - std::io::Write::write_fmt::hb978956bb1b85e2b
   3:        0x1062c14ca - std::sys_common::backtrace::print::hc9e298c4664da113
   4:        0x1062c48c3 - std::panicking::default_hook::{{closure}}::hb97411d6e916e1d2
   5:        0x1062c4618 - std::panicking::default_hook::hc3ac81176817192f
   6:        0x10fee1d8a - rustc_driver[38920cb2344860e2]::DEFAULT_HOOK::{closure#0}::{closure#0}
   7:        0x1062c50b9 - std::panicking::rust_panic_with_hook::hc11209fa2686218a
   8:        0x11056faf7 - std[963c226d0575182f]::panicking::begin_panic::<rustc_errors[112d18aeec5719f8]::ExplicitBug>::{closure#0}
   9:        0x110565619 - std[963c226d0575182f]::sys_common::backtrace::__rust_end_short_backtrace::<std[963c226d0575182f]::panicking::begin_panic<rustc_errors[112d18aeec5719f8]::ExplicitBug>::{closure#0}, !>
  10:        0x114370209 - std[963c226d0575182f]::panicking::begin_panic::<rustc_errors[112d18aeec5719f8]::ExplicitBug>
  11:        0x11064aa29 - std[963c226d0575182f]::panic::panic_any::<rustc_errors[112d18aeec5719f8]::ExplicitBug>
  12:        0x110647f48 - <rustc_errors[112d18aeec5719f8]::HandlerInner>::span_bug::<rustc_span[abe350e59e28df37]::span_encoding::Span, &alloc[622432b1fc1d0ab9]::string::String>
  13:        0x110647d5e - <rustc_errors[112d18aeec5719f8]::Handler>::span_bug::<rustc_span[abe350e59e28df37]::span_encoding::Span, &alloc[622432b1fc1d0ab9]::string::String>
  14:        0x1105c90eb - rustc_middle[7044477369b49eec]::util::bug::opt_span_bug_fmt::<rustc_span[abe350e59e28df37]::span_encoding::Span>::{closure#0}
  15:        0x1105c9147 - rustc_middle[7044477369b49eec]::ty::context::tls::with_opt::<rustc_middle[7044477369b49eec]::util::bug::opt_span_bug_fmt<rustc_span[abe350e59e28df37]::span_encoding::Span>::{closure#0}, !>::{closure#0}
  16:        0x1105c84ef - rustc_middle[7044477369b49eec]::ty::context::tls::with_context_opt::<rustc_middle[7044477369b49eec]::ty::context::tls::with_opt<rustc_middle[7044477369b49eec]::util::bug::opt_span_bug_fmt<rustc_span[abe350e59e28df37]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
  17:        0x1105c8491 - rustc_middle[7044477369b49eec]::util::bug::opt_span_bug_fmt::<rustc_span[abe350e59e28df37]::span_encoding::Span>
  18:        0x1143701ff - rustc_middle[7044477369b49eec]::util::bug::span_bug_fmt::<rustc_span[abe350e59e28df37]::span_encoding::Span>
  19:        0x1105c1fa0 - <rustc_infer[6cab06927fa701c3]::infer::region_constraints::RegionConstraintCollector>::make_subregion
  20:        0x1105baf82 - <rustc_infer[6cab06927fa701c3]::infer::region_constraints::RegionConstraintCollector>::make_eqregion
  21:        0x1105cefda - <rustc_infer[6cab06927fa701c3]::infer::equate::Equate as rustc_middle[7044477369b49eec]::ty::relate::TypeRelation>::regions
  22:        0x1105d7470 - rustc_middle[7044477369b49eec]::ty::relate::super_relate_tys::<rustc_infer[6cab06927fa701c3]::infer::equate::Equate>
  23:        0x1105546e0 - <rustc_infer[6cab06927fa701c3]::infer::InferCtxt>::super_combine_tys::<rustc_infer[6cab06927fa701c3]::infer::equate::Equate>
  24:        0x1105d3289 - <rustc_infer[6cab06927fa701c3]::infer::equate::Equate as rustc_middle[7044477369b49eec]::ty::relate::TypeRelation>::tys
  25:        0x110186e13 - <rustc_infer[6cab06927fa701c3]::infer::InferCtxt>::commit_if_ok::<rustc_infer[6cab06927fa701c3]::infer::InferOk<()>, rustc_middle[7044477369b49eec]::ty::error::TypeError, <rustc_infer[6cab06927fa701c3]::infer::at::Trace>::eq<rustc_middle[7044477369b49eec]::ty::Ty>::{closure#0}>
  26:        0x110188790 - <rustc_infer[6cab06927fa701c3]::infer::InferCtxt>::can_eq::<rustc_middle[7044477369b49eec]::ty::Ty>
  27:        0x11029c5ab - <&mut core[fd5e363bb4760a86]::iter::adapters::cloned::clone_try_fold<rustc_span[abe350e59e28df37]::def_id::DefId, (), core[fd5e363bb4760a86]::ops::control_flow::ControlFlow<()>, core[fd5e363bb4760a86]::iter::traits::iterator::Iterator::any::check<rustc_span[abe350e59e28df37]::def_id::DefId, <dyn rustc_hir_analysis[27a8f7e0703a01ee]::astconv::AstConv>::associated_path_to_ty::{closure#0}::{closure#6}::{closure#1}>::{closure#0}>::{closure#0} as core[fd5e363bb4760a86]::ops::function::FnMut<((), &rustc_span[abe350e59e28df37]::def_id::DefId)>>::call_mut
  28:        0x11024a866 - <core[fd5e363bb4760a86]::iter::adapters::chain::Chain<core[fd5e363bb4760a86]::slice::iter::Iter<rustc_span[abe350e59e28df37]::def_id::DefId>, core[fd5e363bb4760a86]::iter::adapters::flatten::FlatMap<indexmap[36a5d8471eda6f04]::map::Iter<rustc_middle[7044477369b49eec]::ty::fast_reject::SimplifiedType, alloc[622432b1fc1d0ab9]::vec::Vec<rustc_span[abe350e59e28df37]::def_id::DefId>>, &alloc[622432b1fc1d0ab9]::vec::Vec<rustc_span[abe350e59e28df37]::def_id::DefId>, <rustc_middle[7044477369b49eec]::ty::context::TyCtxt>::all_impls::{closure#0}>> as core[fd5e363bb4760a86]::iter::traits::iterator::Iterator>::try_fold::<(), core[fd5e363bb4760a86]::iter::adapters::cloned::clone_try_fold<rustc_span[abe350e59e28df37]::def_id::DefId, (), core[fd5e363bb4760a86]::ops::control_flow::ControlFlow<()>, core[fd5e363bb4760a86]::iter::traits::iterator::Iterator::any::check<rustc_span[abe350e59e28df37]::def_id::DefId, <dyn rustc_hir_analysis[27a8f7e0703a01ee]::astconv::AstConv>::associated_path_to_ty::{closure#0}::{closure#6}::{closure#1}>::{closure#0}>::{closure#0}, core[fd5e363bb4760a86]::ops::control_flow::ControlFlow<()>>
  29:        0x110138c90 - <&mut <dyn rustc_hir_analysis[27a8f7e0703a01ee]::astconv::AstConv>::associated_path_to_ty::{closure#0}::{closure#6} as core[fd5e363bb4760a86]::ops::function::FnMut<(&rustc_span[abe350e59e28df37]::def_id::DefId,)>>::call_mut
  30:        0x110210512 - <alloc[622432b1fc1d0ab9]::vec::Vec<alloc[622432b1fc1d0ab9]::string::String> as alloc[622432b1fc1d0ab9]::vec::spec_from_iter::SpecFromIter<alloc[622432b1fc1d0ab9]::string::String, core[fd5e363bb4760a86]::iter::adapters::map::Map<core[fd5e363bb4760a86]::iter::adapters::filter::Filter<core[fd5e363bb4760a86]::iter::adapters::flatten::FlatMap<core[fd5e363bb4760a86]::iter::adapters::chain::Chain<core[fd5e363bb4760a86]::iter::sources::once::Once<rustc_span[abe350e59e28df37]::def_id::CrateNum>, core[fd5e363bb4760a86]::iter::adapters::copied::Copied<core[fd5e363bb4760a86]::slice::iter::Iter<rustc_span[abe350e59e28df37]::def_id::CrateNum>>>, core[fd5e363bb4760a86]::iter::adapters::copied::Copied<core[fd5e363bb4760a86]::slice::iter::Iter<rustc_span[abe350e59e28df37]::def_id::DefId>>, <rustc_middle[7044477369b49eec]::ty::context::TyCtxt>::all_traits::{closure#0}>, <dyn rustc_hir_analysis[27a8f7e0703a01ee]::astconv::AstConv>::associated_path_to_ty::{closure#0}::{closure#6}>, <dyn rustc_hir_analysis[27a8f7e0703a01ee]::astconv::AstConv>::associated_path_to_ty::{closure#0}::{closure#7}>>>::from_iter
  31:        0x11015d265 - <dyn rustc_hir_analysis[27a8f7e0703a01ee]::astconv::AstConv>::associated_path_to_ty::{closure#0}
  32:        0x1101634dc - <dyn rustc_hir_analysis[27a8f7e0703a01ee]::astconv::AstConv>::ast_ty_to_ty_inner::{closure#0}
  33:        0x1101540cf - <<dyn rustc_hir_analysis[27a8f7e0703a01ee]::astconv::AstConv>::create_substs_for_ast_path::{closure#0}::SubstsForAstPathCtxt as rustc_hir_analysis[27a8f7e0703a01ee]::astconv::CreateSubstsForGenericArgsCtxt>::provided_kind::{closure#0}
  34:        0x110153d43 - <<dyn rustc_hir_analysis[27a8f7e0703a01ee]::astconv::AstConv>::create_substs_for_ast_path::{closure#0}::SubstsForAstPathCtxt as rustc_hir_analysis[27a8f7e0703a01ee]::astconv::CreateSubstsForGenericArgsCtxt>::provided_kind
  35:        0x1101ac593 - rustc_hir_analysis[27a8f7e0703a01ee]::astconv::generics::create_substs_for_generic_args::<<dyn rustc_hir_analysis[27a8f7e0703a01ee]::astconv::AstConv>::create_substs_for_ast_path::{closure#0}::SubstsForAstPathCtxt>
  36:        0x1101538be - <dyn rustc_hir_analysis[27a8f7e0703a01ee]::astconv::AstConv>::create_substs_for_ast_path
  37:        0x11013dd5b - <dyn rustc_hir_analysis[27a8f7e0703a01ee]::astconv::AstConv>::instantiate_poly_trait_ref_inner
  38:        0x11015563a - <dyn rustc_hir_analysis[27a8f7e0703a01ee]::astconv::AstConv>::instantiate_poly_trait_ref
  39:        0x110155df6 - <dyn rustc_hir_analysis[27a8f7e0703a01ee]::astconv::AstConv>::add_bounds::<core[fd5e363bb4760a86]::slice::iter::Iter<rustc_hir[491a8d112bcaed74]::hir::GenericBound>>
  40:        0x1101fcb5e - rustc_hir_analysis[27a8f7e0703a01ee]::collect::predicates_of::gather_explicit_predicates_of
  41:        0x1101f9f0d - rustc_hir_analysis[27a8f7e0703a01ee]::collect::predicates_of::explicit_predicates_of
  42:        0x1114e81fd - <rustc_query_system[3d399bab0eaade7f]::dep_graph::graph::DepGraph<rustc_middle[7044477369b49eec]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[7044477369b49eec]::ty::context::TyCtxt, rustc_span[abe350e59e28df37]::def_id::DefId, rustc_middle[7044477369b49eec]::ty::generics::GenericPredicates>
  43:        0x11127f7aa - rustc_query_system[3d399bab0eaade7f]::query::plumbing::try_execute_query::<rustc_query_impl[469a71c953212c97]::queries::explicit_predicates_of, rustc_query_impl[469a71c953212c97]::plumbing::QueryCtxt>
  44:        0x1113310ce - rustc_query_system[3d399bab0eaade7f]::query::plumbing::get_query::<rustc_query_impl[469a71c953212c97]::queries::explicit_predicates_of, rustc_query_impl[469a71c953212c97]::plumbing::QueryCtxt, rustc_middle[7044477369b49eec]::dep_graph::dep_node::DepKind>
  45:        0x111405345 - <rustc_query_impl[469a71c953212c97]::Queries as rustc_middle[7044477369b49eec]::ty::query::QueryEngine>::explicit_predicates_of
  46:        0x1102b8e47 - rustc_hir_analysis[27a8f7e0703a01ee]::collect::predicates_defined_on
  47:        0x1114e81fd - <rustc_query_system[3d399bab0eaade7f]::dep_graph::graph::DepGraph<rustc_middle[7044477369b49eec]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[7044477369b49eec]::ty::context::TyCtxt, rustc_span[abe350e59e28df37]::def_id::DefId, rustc_middle[7044477369b49eec]::ty::generics::GenericPredicates>
  48:        0x111273bfe - rustc_query_system[3d399bab0eaade7f]::query::plumbing::try_execute_query::<rustc_query_impl[469a71c953212c97]::queries::predicates_defined_on, rustc_query_impl[469a71c953212c97]::plumbing::QueryCtxt>
  49:        0x111330f8e - rustc_query_system[3d399bab0eaade7f]::query::plumbing::get_query::<rustc_query_impl[469a71c953212c97]::queries::predicates_defined_on, rustc_query_impl[469a71c953212c97]::plumbing::QueryCtxt, rustc_middle[7044477369b49eec]::dep_graph::dep_node::DepKind>
  50:        0x1114051b5 - <rustc_query_impl[469a71c953212c97]::Queries as rustc_middle[7044477369b49eec]::ty::query::QueryEngine>::predicates_defined_on
  51:        0x1101f93dd - rustc_hir_analysis[27a8f7e0703a01ee]::collect::predicates_of::predicates_of
  52:        0x1114e81fd - <rustc_query_system[3d399bab0eaade7f]::dep_graph::graph::DepGraph<rustc_middle[7044477369b49eec]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[7044477369b49eec]::ty::context::TyCtxt, rustc_span[abe350e59e28df37]::def_id::DefId, rustc_middle[7044477369b49eec]::ty::generics::GenericPredicates>
  53:        0x1111e755e - rustc_query_system[3d399bab0eaade7f]::query::plumbing::try_execute_query::<rustc_query_impl[469a71c953212c97]::queries::predicates_of, rustc_query_impl[469a71c953212c97]::plumbing::QueryCtxt>
  54:        0x11132f69e - rustc_query_system[3d399bab0eaade7f]::query::plumbing::get_query::<rustc_query_impl[469a71c953212c97]::queries::predicates_of, rustc_query_impl[469a71c953212c97]::plumbing::QueryCtxt, rustc_middle[7044477369b49eec]::dep_graph::dep_node::DepKind>
  55:        0x1114037e5 - <rustc_query_impl[469a71c953212c97]::Queries as rustc_middle[7044477369b49eec]::ty::query::QueryEngine>::predicates_of
  56:        0x1102b165f - rustc_hir_analysis[27a8f7e0703a01ee]::collect::convert_item
  57:        0x1102aae35 - <rustc_hir_analysis[27a8f7e0703a01ee]::collect::CollectItemTypesVisitor as rustc_hir[491a8d112bcaed74]::intravisit::Visitor>::visit_item
  58:        0x1101986a7 - <rustc_middle[7044477369b49eec]::hir::map::Map>::visit_item_likes_in_module::<rustc_hir_analysis[27a8f7e0703a01ee]::collect::CollectItemTypesVisitor>
  59:        0x1102aa385 - rustc_hir_analysis[27a8f7e0703a01ee]::collect::collect_mod_item_types
  60:        0x1114da194 - <rustc_query_system[3d399bab0eaade7f]::dep_graph::graph::DepGraph<rustc_middle[7044477369b49eec]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[7044477369b49eec]::ty::context::TyCtxt, rustc_span[abe350e59e28df37]::def_id::LocalDefId, ()>
  61:        0x11127a36f - rustc_query_system[3d399bab0eaade7f]::query::plumbing::try_execute_query::<rustc_query_impl[469a71c953212c97]::queries::collect_mod_item_types, rustc_query_impl[469a71c953212c97]::plumbing::QueryCtxt>
  62:        0x11140797e - <rustc_query_impl[469a71c953212c97]::Queries as rustc_middle[7044477369b49eec]::ty::query::QueryEngine>::collect_mod_item_types
  63:        0x1101998ba - <rustc_session[d7fa5f284918d396]::session::Session>::track_errors::<rustc_hir_analysis[27a8f7e0703a01ee]::check_crate::{closure#0}, ()>
  64:        0x110134bc1 - rustc_hir_analysis[27a8f7e0703a01ee]::check_crate
  65:        0x110690079 - rustc_interface[d2d1d1fbee7644ce]::passes::analysis
  66:        0x11150ae99 - <rustc_query_system[3d399bab0eaade7f]::dep_graph::graph::DepGraph<rustc_middle[7044477369b49eec]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[7044477369b49eec]::ty::context::TyCtxt, (), core[fd5e363bb4760a86]::result::Result<(), rustc_errors[112d18aeec5719f8]::ErrorGuaranteed>>
  67:        0x1112e613b - rustc_query_system[3d399bab0eaade7f]::query::plumbing::try_execute_query::<rustc_query_impl[469a71c953212c97]::queries::analysis, rustc_query_impl[469a71c953212c97]::plumbing::QueryCtxt>
  68:        0x1114035a8 - <rustc_query_impl[469a71c953212c97]::Queries as rustc_middle[7044477369b49eec]::ty::query::QueryEngine>::analysis
  69:        0x10fe7396a - <rustc_interface[d2d1d1fbee7644ce]::passes::QueryContext>::enter::<rustc_driver[38920cb2344860e2]::run_compiler::{closure#1}::{closure#2}::{closure#2}, core[fd5e363bb4760a86]::result::Result<(), rustc_errors[112d18aeec5719f8]::ErrorGuaranteed>>
  70:        0x10fe54f5d - <rustc_interface[d2d1d1fbee7644ce]::queries::QueryResult<rustc_interface[d2d1d1fbee7644ce]::passes::QueryContext>>::enter::<core[fd5e363bb4760a86]::result::Result<(), rustc_errors[112d18aeec5719f8]::ErrorGuaranteed>, rustc_driver[38920cb2344860e2]::run_compiler::{closure#1}::{closure#2}::{closure#2}>
  71:        0x10feb2da3 - <rustc_interface[d2d1d1fbee7644ce]::interface::Compiler>::enter::<rustc_driver[38920cb2344860e2]::run_compiler::{closure#1}::{closure#2}, core[fd5e363bb4760a86]::result::Result<core[fd5e363bb4760a86]::option::Option<rustc_interface[d2d1d1fbee7644ce]::queries::Linker>, rustc_errors[112d18aeec5719f8]::ErrorGuaranteed>>
  72:        0x10fecfa86 - rustc_span[abe350e59e28df37]::with_source_map::<core[fd5e363bb4760a86]::result::Result<(), rustc_errors[112d18aeec5719f8]::ErrorGuaranteed>, rustc_interface[d2d1d1fbee7644ce]::interface::run_compiler<core[fd5e363bb4760a86]::result::Result<(), rustc_errors[112d18aeec5719f8]::ErrorGuaranteed>, rustc_driver[38920cb2344860e2]::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
  73:        0x10fe7a3e5 - std[963c226d0575182f]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[d2d1d1fbee7644ce]::util::run_in_thread_pool_with_globals<rustc_interface[d2d1d1fbee7644ce]::interface::run_compiler<core[fd5e363bb4760a86]::result::Result<(), rustc_errors[112d18aeec5719f8]::ErrorGuaranteed>, rustc_driver[38920cb2344860e2]::run_compiler::{closure#1}>::{closure#0}, core[fd5e363bb4760a86]::result::Result<(), rustc_errors[112d18aeec5719f8]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[fd5e363bb4760a86]::result::Result<(), rustc_errors[112d18aeec5719f8]::ErrorGuaranteed>>
  74:        0x10fe59385 - <<std[963c226d0575182f]::thread::Builder>::spawn_unchecked_<rustc_interface[d2d1d1fbee7644ce]::util::run_in_thread_pool_with_globals<rustc_interface[d2d1d1fbee7644ce]::interface::run_compiler<core[fd5e363bb4760a86]::result::Result<(), rustc_errors[112d18aeec5719f8]::ErrorGuaranteed>, rustc_driver[38920cb2344860e2]::run_compiler::{closure#1}>::{closure#0}, core[fd5e363bb4760a86]::result::Result<(), rustc_errors[112d18aeec5719f8]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[fd5e363bb4760a86]::result::Result<(), rustc_errors[112d18aeec5719f8]::ErrorGuaranteed>>::{closure#1} as core[fd5e363bb4760a86]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  75:        0x1062ce5a7 - std::sys::unix::thread::Thread::new::thread_start::had0599fead9033cd
  76:     0x7ff805d601d3 - __pthread_start

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.2 (9eb3afe9e 2023-03-27) running on x86_64-apple-darwin

note: compiler flags: --crate-type lib -C embed-bitcode=no -C split-debuginfo=unpacked -C debuginfo=2 -C incremental=[REDACTED]

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

query stack during panic:
#0 [explicit_predicates_of] computing explicit predicates of `validators::all::<impl at verifyr/src/validators/all.rs:5:1: 5:35>`
#1 [predicates_defined_on] computing predicates of `validators::all::<impl at verifyr/src/validators/all.rs:5:1: 5:35>`
#2 [predicates_of] computing predicates of `validators::all::<impl at verifyr/src/validators/all.rs:5:1: 5:35>`
#3 [collect_mod_item_types] collecting item types in module `validators::all`
#4 [analysis] running analysis passes on this crate
end of query stack
error: could not compile `verifyr`
Backtrace

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:22 ~ verifyr[d95f]::validators::all::{impl#0}::'iter#1), 'iter) })

thread 'rustc' panicked at 'Box<dyn Any>', /rustc/9eb3afe9ebe9c7d2b84b71002d44f4a0edac95e0/compiler/rustc_errors/src/lib.rs:987:33
stack backtrace:
   0: std::panicking::begin_panic::<rustc_errors::ExplicitBug>
   1: std::panic::panic_any::<rustc_errors::ExplicitBug>
   2: <rustc_errors::HandlerInner>::span_bug::<rustc_span::span_encoding::Span, &alloc::string::String>
   3: <rustc_errors::Handler>::span_bug::<rustc_span::span_encoding::Span, &alloc::string::String>
   4: rustc_middle::util::bug::opt_span_bug_fmt::<rustc_span::span_encoding::Span>::{closure#0}
   5: rustc_middle::ty::context::tls::with_opt::<rustc_middle::util::bug::opt_span_bug_fmt<rustc_span::span_encoding::Span>::{closure#0}, !>::{closure#0}
   6: rustc_middle::ty::context::tls::with_context_opt::<rustc_middle::ty::context::tls::with_opt<rustc_middle::util::bug::opt_span_bug_fmt<rustc_span::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
   7: rustc_middle::util::bug::opt_span_bug_fmt::<rustc_span::span_encoding::Span>
   8: rustc_middle::util::bug::span_bug_fmt::<rustc_span::span_encoding::Span>
   9: <rustc_infer::infer::region_constraints::RegionConstraintCollector>::make_subregion
  10: <rustc_infer::infer::region_constraints::RegionConstraintCollector>::make_eqregion
  11: <rustc_infer::infer::equate::Equate as rustc_middle::ty::relate::TypeRelation>::regions
  12: rustc_middle::ty::relate::super_relate_tys::<rustc_infer::infer::equate::Equate>
  13: <rustc_infer::infer::InferCtxt>::super_combine_tys::<rustc_infer::infer::equate::Equate>
  14: <rustc_infer::infer::equate::Equate as rustc_middle::ty::relate::TypeRelation>::tys
  15: <rustc_infer::infer::InferCtxt>::commit_if_ok::<rustc_infer::infer::InferOk<()>, rustc_middle::ty::error::TypeError, <rustc_infer::infer::at::Trace>::eq<rustc_middle::ty::Ty>::{closure#0}>
  16: <rustc_infer::infer::InferCtxt>::can_eq::<rustc_middle::ty::Ty>
  17: <&mut core::iter::adapters::cloned::clone_try_fold<rustc_span::def_id::DefId, (), core::ops::control_flow::ControlFlow<()>, core::iter::traits::iterator::Iterator::any::check<rustc_span::def_id::DefId, <dyn rustc_hir_analysis::astconv::AstConv>::associated_path_to_ty::{closure#0}::{closure#6}::{closure#1}>::{closure#0}>::{closure#0} as core::ops::function::FnMut<((), &rustc_span::def_id::DefId)>>::call_mut
  18: <core::iter::adapters::chain::Chain<core::slice::iter::Iter<rustc_span::def_id::DefId>, core::iter::adapters::flatten::FlatMap<indexmap::map::Iter<rustc_middle::ty::fast_reject::SimplifiedType, alloc::vec::Vec<rustc_span::def_id::DefId>>, &alloc::vec::Vec<rustc_span::def_id::DefId>, <rustc_middle::ty::context::TyCtxt>::all_impls::{closure#0}>> as core::iter::traits::iterator::Iterator>::try_fold::<(), core::iter::adapters::cloned::clone_try_fold<rustc_span::def_id::DefId, (), core::ops::control_flow::ControlFlow<()>, core::iter::traits::iterator::Iterator::any::check<rustc_span::def_id::DefId, <dyn rustc_hir_analysis::astconv::AstConv>::associated_path_to_ty::{closure#0}::{closure#6}::{closure#1}>::{closure#0}>::{closure#0}, core::ops::control_flow::ControlFlow<()>>
  19: <&mut <dyn rustc_hir_analysis::astconv::AstConv>::associated_path_to_ty::{closure#0}::{closure#6} as core::ops::function::FnMut<(&rustc_span::def_id::DefId,)>>::call_mut
  20: <alloc::vec::Vec<alloc::string::String> as alloc::vec::spec_from_iter::SpecFromIter<alloc::string::String, core::iter::adapters::map::Map<core::iter::adapters::filter::Filter<core::iter::adapters::flatten::FlatMap<core::iter::adapters::chain::Chain<core::iter::sources::once::Once<rustc_span::def_id::CrateNum>, core::iter::adapters::copied::Copied<core::slice::iter::Iter<rustc_span::def_id::CrateNum>>>, core::iter::adapters::copied::Copied<core::slice::iter::Iter<rustc_span::def_id::DefId>>, <rustc_middle::ty::context::TyCtxt>::all_traits::{closure#0}>, <dyn rustc_hir_analysis::astconv::AstConv>::associated_path_to_ty::{closure#0}::{closure#6}>, <dyn rustc_hir_analysis::astconv::AstConv>::associated_path_to_ty::{closure#0}::{closure#7}>>>::from_iter
  21: <dyn rustc_hir_analysis::astconv::AstConv>::associated_path_to_ty::{closure#0}
  22: <dyn rustc_hir_analysis::astconv::AstConv>::ast_ty_to_ty_inner::{closure#0}
  23: <<dyn rustc_hir_analysis::astconv::AstConv>::create_substs_for_ast_path::{closure#0}::SubstsForAstPathCtxt as rustc_hir_analysis::astconv::CreateSubstsForGenericArgsCtxt>::provided_kind::{closure#0}
  24: <<dyn rustc_hir_analysis::astconv::AstConv>::create_substs_for_ast_path::{closure#0}::SubstsForAstPathCtxt as rustc_hir_analysis::astconv::CreateSubstsForGenericArgsCtxt>::provided_kind
  25: rustc_hir_analysis::astconv::generics::create_substs_for_generic_args::<<dyn rustc_hir_analysis::astconv::AstConv>::create_substs_for_ast_path::{closure#0}::SubstsForAstPathCtxt>
  26: <dyn rustc_hir_analysis::astconv::AstConv>::create_substs_for_ast_path
  27: <dyn rustc_hir_analysis::astconv::AstConv>::instantiate_poly_trait_ref_inner
  28: <dyn rustc_hir_analysis::astconv::AstConv>::instantiate_poly_trait_ref
  29: <dyn rustc_hir_analysis::astconv::AstConv>::add_bounds::<core::slice::iter::Iter<rustc_hir::hir::GenericBound>>
  30: rustc_hir_analysis::collect::predicates_of::gather_explicit_predicates_of
  31: rustc_hir_analysis::collect::predicates_of::explicit_predicates_of
  32: <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle::ty::context::TyCtxt, rustc_span::def_id::DefId, rustc_middle::ty::generics::GenericPredicates>
  33: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::explicit_predicates_of, rustc_query_impl::plumbing::QueryCtxt>
  34: rustc_query_system::query::plumbing::get_query::<rustc_query_impl::queries::explicit_predicates_of, rustc_query_impl::plumbing::QueryCtxt, rustc_middle::dep_graph::dep_node::DepKind>
  35: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::explicit_predicates_of
  36: rustc_hir_analysis::collect::predicates_defined_on
  37: <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle::ty::context::TyCtxt, rustc_span::def_id::DefId, rustc_middle::ty::generics::GenericPredicates>
  38: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::predicates_defined_on, rustc_query_impl::plumbing::QueryCtxt>
  39: rustc_query_system::query::plumbing::get_query::<rustc_query_impl::queries::predicates_defined_on, rustc_query_impl::plumbing::QueryCtxt, rustc_middle::dep_graph::dep_node::DepKind>
  40: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::predicates_defined_on
  41: rustc_hir_analysis::collect::predicates_of::predicates_of
  42: <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle::ty::context::TyCtxt, rustc_span::def_id::DefId, rustc_middle::ty::generics::GenericPredicates>
  43: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::predicates_of, rustc_query_impl::plumbing::QueryCtxt>
  44: rustc_query_system::query::plumbing::get_query::<rustc_query_impl::queries::predicates_of, rustc_query_impl::plumbing::QueryCtxt, rustc_middle::dep_graph::dep_node::DepKind>
  45: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::predicates_of
  46: rustc_hir_analysis::collect::convert_item
  47: <rustc_hir_analysis::collect::CollectItemTypesVisitor as rustc_hir::intravisit::Visitor>::visit_item
  48: <rustc_middle::hir::map::Map>::visit_item_likes_in_module::<rustc_hir_analysis::collect::CollectItemTypesVisitor>
  49: rustc_hir_analysis::collect::collect_mod_item_types
  50: <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle::ty::context::TyCtxt, rustc_span::def_id::LocalDefId, ()>
  51: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::collect_mod_item_types, rustc_query_impl::plumbing::QueryCtxt>
  52: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::collect_mod_item_types
  53: <rustc_session::session::Session>::track_errors::<rustc_hir_analysis::check_crate::{closure#0}, ()>
  54: rustc_hir_analysis::check_crate
  55: rustc_interface::passes::analysis
  56: <rustc_query_system::dep_graph::graph::DepGraph<rustc_middle::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle::ty::context::TyCtxt, (), core::result::Result<(), rustc_errors::ErrorGuaranteed>>
  57: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::analysis, rustc_query_impl::plumbing::QueryCtxt>
  58: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::analysis
  59: <rustc_interface::passes::QueryContext>::enter::<rustc_driver::run_compiler::{closure#1}::{closure#2}::{closure#2}, core::result::Result<(), rustc_errors::ErrorGuaranteed>>
  60: <rustc_interface::queries::QueryResult<rustc_interface::passes::QueryContext>>::enter::<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_driver::run_compiler::{closure#1}::{closure#2}::{closure#2}>
  61: <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>>
  62: rustc_span::with_source_map::<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_interface::interface::run_compiler<core::result::Result<(), rustc_errors::ErrorGuaranteed>, rustc_driver::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
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.68.2 (9eb3afe9e 2023-03-27) running on x86_64-apple-darwin

note: compiler flags: --crate-type lib -C embed-bitcode=no -C split-debuginfo=unpacked -C debuginfo=2 -C incremental=[REDACTED]

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

query stack during panic:
#0 [explicit_predicates_of] computing explicit predicates of `validators::all::<impl at verifyr/src/validators/all.rs:5:1: 5:35>`
#1 [predicates_defined_on] computing predicates of `validators::all::<impl at verifyr/src/validators/all.rs:5:1: 5:35>`
#2 [predicates_of] computing predicates of `validators::all::<impl at verifyr/src/validators/all.rs:5:1: 5:35>`
#3 [collect_mod_item_types] collecting item types in module `validators::all`
#4 [analysis] running analysis passes on this crate
end of query stack
error: could not compile `verifyr`

@Altair-Bueno Altair-Bueno 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 Apr 3, 2023
@fmease
Copy link
Member

fmease commented Apr 3, 2023

Already fixed on beta and nightly (by #108575). Duplicate of #108562.

@matthiaskrgr matthiaskrgr added the E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. label Apr 7, 2023
@JohnTitor
Copy link
Member

Triage: #108575 should have a test case covering this case, closing without a regression test. Thanks!

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. E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been 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.
Projects
None yet
Development

No branches or pull requests

4 participants