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: 'unexpected non-GAT usage of an anon const' when using Inherent associated type with const generic #109759

Closed
ZippeyKeys12 opened this issue Mar 30, 2023 · 4 comments · Fixed by #110817
Assignees
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. F-inherent_associated_types `#![feature(inherent_associated_types)]` 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

@ZippeyKeys12
Copy link

ZippeyKeys12 commented Mar 30, 2023

Code

#![feature(inherent_associated_types)]
#![allow(incomplete_features, dead_code, unused_variables)]

struct Foo;

struct Bar<const X: usize>([(); X]);

impl<const X: usize> Bar<X> {
    pub fn new() -> Self {
        Self([(); X])
    }
}

impl Foo {
    type Bar<const X: usize> = Bar<X>;
}

fn main() {
    let a = Foo::Bar::<10usize>::new();
}

I used 10usize since just 10 gave a cannot infer type for type {integer}` error.
Don't know if it's related, but thought I should mention it.

Meta

rustc --version --verbose:

rustc 1.70.0-nightly (17c116721 2023-03-29)
binary: rustc
commit-hash: 17c11672167827b0dd92c88ef69f24346d1286dd
commit-date: 2023-03-29
host: x86_64-apple-darwin
release: 1.70.0-nightly
LLVM version: 16.0.0

Error output

   Compiling ice v0.1.0 (/Users/zippeykeys12/Documents/ice)
error: internal compiler error: no errors encountered even though `delay_span_bug` issued

error: internal compiler error: unexpected non-GAT usage of an anon const
  --> ice.rs:19:24
   |
19 |     let a = Foo::Bar::<10usize>::new();
   |                        ^^^^^^^
   |
   = note: delayed at    0: std::backtrace::Backtrace::create
              1: std::backtrace::Backtrace::force_capture
              2: <rustc_errors::HandlerInner>::emit_diagnostic
              3: <rustc_errors::Handler>::delay_span_bug::<rustc_span::span_encoding::Span, &str>
              4: rustc_hir_analysis::collect::type_of::opt_const_param_of
              5: <rustc_middle::dep_graph::dep_node::DepKind as rustc_query_system::dep_graph::DepKind>::with_deps::<<rustc_query_system::dep_graph::graph::DepGraphData<rustc_middle::dep_graph::dep_node::DepKind>>::with_task<(rustc_query_impl::plumbing::QueryCtxt, rustc_query_impl::queries::opt_const_param_of), rustc_span::def_id::LocalDefId, core::option::Option<rustc_span::def_id::DefId>>::{closure#0}, core::option::Option<rustc_span::def_id::DefId>>
              6: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<rustc_query_system::query::plumbing::execute_job_incr<rustc_query_impl::queries::opt_const_param_of, rustc_query_impl::plumbing::QueryCtxt>::{closure#2}, (core::option::Option<rustc_span::def_id::DefId>, rustc_query_system::dep_graph::graph::DepNodeIndex)>::{closure#0}, (core::option::Option<rustc_span::def_id::DefId>, rustc_query_system::dep_graph::graph::DepNodeIndex)>
              7: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::opt_const_param_of, rustc_query_impl::plumbing::QueryCtxt>
              8: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::opt_const_param_of
              9: rustc_hir_typeck::typeck
             10: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<rustc_query_system::query::plumbing::execute_job_incr<rustc_query_impl::queries::typeck, rustc_query_impl::plumbing::QueryCtxt>::{closure#2}, (&rustc_middle::ty::typeck_results::TypeckResults, rustc_query_system::dep_graph::graph::DepNodeIndex)>::{closure#0}, (&rustc_middle::ty::typeck_results::TypeckResults, rustc_query_system::dep_graph::graph::DepNodeIndex)>
             11: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::typeck, rustc_query_impl::plumbing::QueryCtxt>
             12: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::typeck
             13: rustc_data_structures::sync::par_for_each_in::<&[rustc_span::def_id::LocalDefId], <rustc_middle::hir::map::Map>::par_body_owners<rustc_hir_typeck::typeck_item_bodies::{closure#0}>::{closure#0}>
             14: rustc_hir_typeck::typeck_item_bodies
             15: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<rustc_query_system::query::plumbing::execute_job_incr<rustc_query_impl::queries::typeck_item_bodies, rustc_query_impl::plumbing::QueryCtxt>::{closure#2}, ((), rustc_query_system::dep_graph::graph::DepNodeIndex)>::{closure#0}, ((), rustc_query_system::dep_graph::graph::DepNodeIndex)>
             16: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::typeck_item_bodies, rustc_query_impl::plumbing::QueryCtxt>
             17: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::typeck_item_bodies
             18: <rustc_session::session::Session>::time::<(), rustc_hir_analysis::check_crate::{closure#7}>
             19: rustc_hir_analysis::check_crate
             20: rustc_interface::passes::analysis
             21: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<rustc_query_system::query::plumbing::execute_job_incr<rustc_query_impl::queries::analysis, rustc_query_impl::plumbing::QueryCtxt>::{closure#2}, (core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_query_system::dep_graph::graph::DepNodeIndex)>::{closure#0}, (core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_query_system::dep_graph::graph::DepNodeIndex)>
             22: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::analysis, rustc_query_impl::plumbing::QueryCtxt>
             23: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::analysis
             24: <rustc_interface::queries::QueryResult<&rustc_middle::ty::context::GlobalCtxt>>::enter::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}::{closure#2}::{closure#4}>
             25: <rustc_interface::interface::Compiler>::enter::<rustc_driver_impl::run_compiler::{closure#1}::{closure#2}, core::result::Result<core::option::Option<rustc_interface::queries::Linker>, rustc_span::ErrorGuaranteed>>
             26: rustc_span::with_source_map::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
             27: std::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
             28: <<std::thread::Builder>::spawn_unchecked_<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#1} as core::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
             29: std::sys::unix::thread::Thread::new::thread_start
             30: __pthread_start
           

error: internal compiler error: unexpected const parent in type_of(): Ty(Ty { hir_id: HirId(DefId(0:17 ~ ice[bc62]::main).9), kind: Path(TypeRelative(Ty { hir_id: HirId(DefId(0:17 ~ ice[bc62]::main).5), kind: Path(Resolved(None, Path { span: ice.rs:19:13: 19:16 (#0), res: Def(Struct, DefId(0:3 ~ ice[bc62]::Foo)), segments: [PathSegment { ident: Foo#0, hir_id: HirId(DefId(0:17 ~ ice[bc62]::main).4), res: Def(Struct, DefId(0:3 ~ ice[bc62]::Foo)), args: None, infer_args: true }] })), span: ice.rs:19:13: 19:16 (#0) }, PathSegment { ident: Bar#0, hir_id: HirId(DefId(0:17 ~ ice[bc62]::main).8), res: Err, args: Some(GenericArgs { args: [Const(ConstArg { value: AnonConst { hir_id: HirId(DefId(0:17 ~ ice[bc62]::main).6), def_id: DefId(0:18 ~ ice[bc62]::main::{constant#0}), body: BodyId { hir_id: HirId(DefId(0:17 ~ ice[bc62]::main).7) } }, span: ice.rs:19:24: 19:31 (#0) })], bindings: [], parenthesized: false, span_ext: ice.rs:19:23: 19:32 (#0) }), infer_args: false })), span: ice.rs:19:13: 19:32 (#0) })
  |
  = note: delayed at    0: std::backtrace::Backtrace::create
             1: std::backtrace::Backtrace::force_capture
             2: <rustc_errors::HandlerInner>::emit_diagnostic
             3: <rustc_errors::Handler>::delay_span_bug::<rustc_span::span_encoding::Span, &str>
             4: rustc_hir_analysis::collect::type_of::type_of
             5: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<rustc_query_system::query::plumbing::execute_job_incr<rustc_query_impl::queries::type_of, rustc_query_impl::plumbing::QueryCtxt>::{closure#2}, (rustc_middle::ty::subst::EarlyBinder<rustc_middle::ty::Ty>, rustc_query_system::dep_graph::graph::DepNodeIndex)>::{closure#0}, (rustc_middle::ty::subst::EarlyBinder<rustc_middle::ty::Ty>, rustc_query_system::dep_graph::graph::DepNodeIndex)>
             6: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::type_of, rustc_query_impl::plumbing::QueryCtxt>
             7: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::type_of
             8: rustc_hir_typeck::typeck
             9: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<rustc_query_system::query::plumbing::execute_job_incr<rustc_query_impl::queries::typeck, rustc_query_impl::plumbing::QueryCtxt>::{closure#2}, (&rustc_middle::ty::typeck_results::TypeckResults, rustc_query_system::dep_graph::graph::DepNodeIndex)>::{closure#0}, (&rustc_middle::ty::typeck_results::TypeckResults, rustc_query_system::dep_graph::graph::DepNodeIndex)>
            10: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::typeck, rustc_query_impl::plumbing::QueryCtxt>
            11: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::typeck
            12: rustc_data_structures::sync::par_for_each_in::<&[rustc_span::def_id::LocalDefId], <rustc_middle::hir::map::Map>::par_body_owners<rustc_hir_typeck::typeck_item_bodies::{closure#0}>::{closure#0}>
            13: rustc_hir_typeck::typeck_item_bodies
            14: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<rustc_query_system::query::plumbing::execute_job_incr<rustc_query_impl::queries::typeck_item_bodies, rustc_query_impl::plumbing::QueryCtxt>::{closure#2}, ((), rustc_query_system::dep_graph::graph::DepNodeIndex)>::{closure#0}, ((), rustc_query_system::dep_graph::graph::DepNodeIndex)>
            15: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::typeck_item_bodies, rustc_query_impl::plumbing::QueryCtxt>
            16: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::typeck_item_bodies
            17: <rustc_session::session::Session>::time::<(), rustc_hir_analysis::check_crate::{closure#7}>
            18: rustc_hir_analysis::check_crate
            19: rustc_interface::passes::analysis
            20: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<rustc_query_system::query::plumbing::execute_job_incr<rustc_query_impl::queries::analysis, rustc_query_impl::plumbing::QueryCtxt>::{closure#2}, (core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_query_system::dep_graph::graph::DepNodeIndex)>::{closure#0}, (core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_query_system::dep_graph::graph::DepNodeIndex)>
            21: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::analysis, rustc_query_impl::plumbing::QueryCtxt>
            22: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::analysis
            23: <rustc_interface::queries::QueryResult<&rustc_middle::ty::context::GlobalCtxt>>::enter::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}::{closure#2}::{closure#4}>
            24: <rustc_interface::interface::Compiler>::enter::<rustc_driver_impl::run_compiler::{closure#1}::{closure#2}, core::result::Result<core::option::Option<rustc_interface::queries::Linker>, rustc_span::ErrorGuaranteed>>
            25: rustc_span::with_source_map::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
            26: std::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
            27: <<std::thread::Builder>::spawn_unchecked_<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#1} as core::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
            28: std::sys::unix::thread::Thread::new::thread_start
            29: __pthread_start
          

error: internal compiler error: mir_const_qualif: MIR had errors
  --> ice.rs:19:24
   |
19 |     let a = Foo::Bar::<10usize>::new();
   |                        ^^^^^^^
   |
   = note: delayed at    0: std::backtrace::Backtrace::create
              1: std::backtrace::Backtrace::force_capture
              2: <rustc_errors::HandlerInner>::emit_diagnostic
              3: <rustc_errors::Handler>::delay_span_bug::<rustc_span::span_encoding::Span, &str>
              4: rustc_mir_transform::mir_const_qualif
              5: <rustc_mir_transform::provide::{closure#0} as core::ops::function::FnOnce<(rustc_middle::ty::context::TyCtxt, rustc_span::def_id::LocalDefId)>>::call_once
              6: <rustc_middle::dep_graph::dep_node::DepKind as rustc_query_system::dep_graph::DepKind>::with_deps::<<rustc_query_system::dep_graph::graph::DepGraphData<rustc_middle::dep_graph::dep_node::DepKind>>::with_task<(rustc_query_impl::plumbing::QueryCtxt, rustc_query_impl::queries::mir_const_qualif), rustc_span::def_id::DefId, rustc_middle::mir::query::ConstQualifs>::{closure#0}, rustc_middle::mir::query::ConstQualifs>
              7: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<rustc_query_system::query::plumbing::execute_job_incr<rustc_query_impl::queries::mir_const_qualif, rustc_query_impl::plumbing::QueryCtxt>::{closure#2}, (rustc_middle::mir::query::ConstQualifs, rustc_query_system::dep_graph::graph::DepNodeIndex)>::{closure#0}, (rustc_middle::mir::query::ConstQualifs, rustc_query_system::dep_graph::graph::DepNodeIndex)>
              8: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::mir_const_qualif, rustc_query_impl::plumbing::QueryCtxt>
              9: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::mir_const_qualif
             10: rustc_mir_transform::mir_promoted
             11: <rustc_query_system::query::plumbing::execute_job_incr<rustc_query_impl::queries::mir_promoted, rustc_query_impl::plumbing::QueryCtxt>::{closure#2}::{closure#2} as core::ops::function::FnOnce<((rustc_query_impl::plumbing::QueryCtxt, rustc_query_impl::queries::mir_promoted), rustc_middle::ty::WithOptConstParam<rustc_span::def_id::LocalDefId>)>>::call_once
             12: <rustc_middle::dep_graph::dep_node::DepKind as rustc_query_system::dep_graph::DepKind>::with_deps::<<rustc_query_system::dep_graph::graph::DepGraphData<rustc_middle::dep_graph::dep_node::DepKind>>::with_task<(rustc_query_impl::plumbing::QueryCtxt, rustc_query_impl::queries::mir_promoted), 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>>)>::{closure#0}, (&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>>)>
             13: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<rustc_query_system::query::plumbing::execute_job_incr<rustc_query_impl::queries::mir_promoted, rustc_query_impl::plumbing::QueryCtxt>::{closure#2}, ((&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>>), rustc_query_system::dep_graph::graph::DepNodeIndex)>::{closure#0}, ((&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>>), rustc_query_system::dep_graph::graph::DepNodeIndex)>
             14: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::mir_promoted, rustc_query_impl::plumbing::QueryCtxt>
             15: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::mir_promoted
             16: rustc_borrowck::mir_borrowck
             17: <rustc_borrowck::provide::{closure#0} as core::ops::function::FnOnce<(rustc_middle::ty::context::TyCtxt, rustc_span::def_id::LocalDefId)>>::call_once
             18: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<rustc_query_system::query::plumbing::execute_job_incr<rustc_query_impl::queries::mir_borrowck, rustc_query_impl::plumbing::QueryCtxt>::{closure#2}, (&rustc_middle::mir::query::BorrowCheckResult, rustc_query_system::dep_graph::graph::DepNodeIndex)>::{closure#0}, (&rustc_middle::mir::query::BorrowCheckResult, rustc_query_system::dep_graph::graph::DepNodeIndex)>
             19: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::mir_borrowck, rustc_query_impl::plumbing::QueryCtxt>
             20: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::mir_borrowck
             21: rustc_data_structures::sync::par_for_each_in::<&[rustc_span::def_id::LocalDefId], <rustc_middle::hir::map::Map>::par_body_owners<rustc_interface::passes::analysis::{closure#2}::{closure#0}>::{closure#0}>
             22: <rustc_session::session::Session>::time::<(), rustc_interface::passes::analysis::{closure#2}>
             23: rustc_interface::passes::analysis
             24: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<rustc_query_system::query::plumbing::execute_job_incr<rustc_query_impl::queries::analysis, rustc_query_impl::plumbing::QueryCtxt>::{closure#2}, (core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_query_system::dep_graph::graph::DepNodeIndex)>::{closure#0}, (core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_query_system::dep_graph::graph::DepNodeIndex)>
             25: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::analysis, rustc_query_impl::plumbing::QueryCtxt>
             26: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::analysis
             27: <rustc_interface::queries::QueryResult<&rustc_middle::ty::context::GlobalCtxt>>::enter::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}::{closure#2}::{closure#4}>
             28: <rustc_interface::interface::Compiler>::enter::<rustc_driver_impl::run_compiler::{closure#1}::{closure#2}, core::result::Result<core::option::Option<rustc_interface::queries::Linker>, rustc_span::ErrorGuaranteed>>
             29: rustc_span::with_source_map::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
             30: std::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
             31: <<std::thread::Builder>::spawn_unchecked_<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#1} as core::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
             32: std::sys::unix::thread::Thread::new::thread_start
             33: __pthread_start
           

error: internal compiler error: broken MIR in DefId(0:18 ~ ice[bc62]::main::{constant#0}) ("return type"): bad type [type error]
  --> ice.rs:19:24
   |
19 |     let a = Foo::Bar::<10usize>::new();
   |                        ^^^^^^^
   |
   = note: delayed at    0: std::backtrace::Backtrace::create
              1: std::backtrace::Backtrace::force_capture
              2: <rustc_errors::HandlerInner>::emit_diagnostic
              3: <rustc_errors::Handler>::delay_span_bug::<rustc_span::span_encoding::Span, &str>
              4: <rustc_borrowck::type_check::TypeVerifier>::sanitize_type
              5: <rustc_borrowck::type_check::TypeVerifier as rustc_middle::mir::visit::Visitor>::visit_body
              6: rustc_borrowck::type_check::type_check
              7: rustc_borrowck::nll::compute_regions
              8: rustc_borrowck::do_mir_borrowck
              9: rustc_borrowck::mir_borrowck
             10: <rustc_borrowck::provide::{closure#0} as core::ops::function::FnOnce<(rustc_middle::ty::context::TyCtxt, rustc_span::def_id::LocalDefId)>>::call_once
             11: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<rustc_query_system::query::plumbing::execute_job_incr<rustc_query_impl::queries::mir_borrowck, rustc_query_impl::plumbing::QueryCtxt>::{closure#2}, (&rustc_middle::mir::query::BorrowCheckResult, rustc_query_system::dep_graph::graph::DepNodeIndex)>::{closure#0}, (&rustc_middle::mir::query::BorrowCheckResult, rustc_query_system::dep_graph::graph::DepNodeIndex)>
             12: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::mir_borrowck, rustc_query_impl::plumbing::QueryCtxt>
             13: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::mir_borrowck
             14: rustc_data_structures::sync::par_for_each_in::<&[rustc_span::def_id::LocalDefId], <rustc_middle::hir::map::Map>::par_body_owners<rustc_interface::passes::analysis::{closure#2}::{closure#0}>::{closure#0}>
             15: <rustc_session::session::Session>::time::<(), rustc_interface::passes::analysis::{closure#2}>
             16: rustc_interface::passes::analysis
             17: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<rustc_query_system::query::plumbing::execute_job_incr<rustc_query_impl::queries::analysis, rustc_query_impl::plumbing::QueryCtxt>::{closure#2}, (core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_query_system::dep_graph::graph::DepNodeIndex)>::{closure#0}, (core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_query_system::dep_graph::graph::DepNodeIndex)>
             18: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::analysis, rustc_query_impl::plumbing::QueryCtxt>
             19: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::analysis
             20: <rustc_interface::queries::QueryResult<&rustc_middle::ty::context::GlobalCtxt>>::enter::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}::{closure#2}::{closure#4}>
             21: <rustc_interface::interface::Compiler>::enter::<rustc_driver_impl::run_compiler::{closure#1}::{closure#2}, core::result::Result<core::option::Option<rustc_interface::queries::Linker>, rustc_span::ErrorGuaranteed>>
             22: rustc_span::with_source_map::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
             23: std::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
             24: <<std::thread::Builder>::spawn_unchecked_<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#1} as core::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
             25: std::sys::unix::thread::Thread::new::thread_start
             26: __pthread_start
           

error: internal compiler error: TyKind::Error constructed but no error reported
  |
  = note: delayed at    0: std::backtrace::Backtrace::create
             1: std::backtrace::Backtrace::force_capture
             2: <rustc_errors::HandlerInner>::emit_diagnostic
             3: <rustc_errors::Handler>::delay_span_bug::<rustc_span::span_encoding::Span, &str>
             4: <rustc_borrowck::type_check::TypeVerifier>::sanitize_type
             5: <rustc_borrowck::type_check::TypeVerifier as rustc_middle::mir::visit::Visitor>::visit_body
             6: rustc_borrowck::type_check::type_check
             7: rustc_borrowck::nll::compute_regions
             8: rustc_borrowck::do_mir_borrowck
             9: rustc_borrowck::mir_borrowck
            10: <rustc_borrowck::provide::{closure#0} as core::ops::function::FnOnce<(rustc_middle::ty::context::TyCtxt, rustc_span::def_id::LocalDefId)>>::call_once
            11: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<rustc_query_system::query::plumbing::execute_job_incr<rustc_query_impl::queries::mir_borrowck, rustc_query_impl::plumbing::QueryCtxt>::{closure#2}, (&rustc_middle::mir::query::BorrowCheckResult, rustc_query_system::dep_graph::graph::DepNodeIndex)>::{closure#0}, (&rustc_middle::mir::query::BorrowCheckResult, rustc_query_system::dep_graph::graph::DepNodeIndex)>
            12: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::mir_borrowck, rustc_query_impl::plumbing::QueryCtxt>
            13: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::mir_borrowck
            14: rustc_data_structures::sync::par_for_each_in::<&[rustc_span::def_id::LocalDefId], <rustc_middle::hir::map::Map>::par_body_owners<rustc_interface::passes::analysis::{closure#2}::{closure#0}>::{closure#0}>
            15: <rustc_session::session::Session>::time::<(), rustc_interface::passes::analysis::{closure#2}>
            16: rustc_interface::passes::analysis
            17: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<rustc_query_system::query::plumbing::execute_job_incr<rustc_query_impl::queries::analysis, rustc_query_impl::plumbing::QueryCtxt>::{closure#2}, (core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_query_system::dep_graph::graph::DepNodeIndex)>::{closure#0}, (core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_query_system::dep_graph::graph::DepNodeIndex)>
            18: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::analysis, rustc_query_impl::plumbing::QueryCtxt>
            19: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::analysis
            20: <rustc_interface::queries::QueryResult<&rustc_middle::ty::context::GlobalCtxt>>::enter::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}::{closure#2}::{closure#4}>
            21: <rustc_interface::interface::Compiler>::enter::<rustc_driver_impl::run_compiler::{closure#1}::{closure#2}, core::result::Result<core::option::Option<rustc_interface::queries::Linker>, rustc_span::ErrorGuaranteed>>
            22: rustc_span::with_source_map::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
            23: std::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
            24: <<std::thread::Builder>::spawn_unchecked_<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#1} as core::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
            25: std::sys::unix::thread::Thread::new::thread_start
            26: __pthread_start
          

error: internal compiler error: broken MIR in DefId(0:18 ~ ice[bc62]::main::{constant#0}) (LocalDecl { mutability: Mut, local_info: Set(Boring), internal: false, ty: [type error], user_ty: None, source_info: SourceInfo { span: ice.rs:19:24: 19:31 (#0), scope: scope[0] } }): bad type [type error]
  --> ice.rs:19:24
   |
19 |     let a = Foo::Bar::<10usize>::new();
   |                        ^^^^^^^
   |
   = note: delayed at    0: std::backtrace::Backtrace::create
              1: std::backtrace::Backtrace::force_capture
              2: <rustc_errors::HandlerInner>::emit_diagnostic
              3: <rustc_errors::Handler>::delay_span_bug::<rustc_span::span_encoding::Span, &str>
              4: <rustc_borrowck::type_check::TypeVerifier>::sanitize_type
              5: <rustc_borrowck::type_check::TypeVerifier as rustc_middle::mir::visit::Visitor>::visit_body
              6: rustc_borrowck::type_check::type_check
              7: rustc_borrowck::nll::compute_regions
              8: rustc_borrowck::do_mir_borrowck
              9: rustc_borrowck::mir_borrowck
             10: <rustc_borrowck::provide::{closure#0} as core::ops::function::FnOnce<(rustc_middle::ty::context::TyCtxt, rustc_span::def_id::LocalDefId)>>::call_once
             11: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<rustc_query_system::query::plumbing::execute_job_incr<rustc_query_impl::queries::mir_borrowck, rustc_query_impl::plumbing::QueryCtxt>::{closure#2}, (&rustc_middle::mir::query::BorrowCheckResult, rustc_query_system::dep_graph::graph::DepNodeIndex)>::{closure#0}, (&rustc_middle::mir::query::BorrowCheckResult, rustc_query_system::dep_graph::graph::DepNodeIndex)>
             12: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::mir_borrowck, rustc_query_impl::plumbing::QueryCtxt>
             13: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::mir_borrowck
             14: rustc_data_structures::sync::par_for_each_in::<&[rustc_span::def_id::LocalDefId], <rustc_middle::hir::map::Map>::par_body_owners<rustc_interface::passes::analysis::{closure#2}::{closure#0}>::{closure#0}>
             15: <rustc_session::session::Session>::time::<(), rustc_interface::passes::analysis::{closure#2}>
             16: rustc_interface::passes::analysis
             17: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<rustc_query_system::query::plumbing::execute_job_incr<rustc_query_impl::queries::analysis, rustc_query_impl::plumbing::QueryCtxt>::{closure#2}, (core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_query_system::dep_graph::graph::DepNodeIndex)>::{closure#0}, (core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_query_system::dep_graph::graph::DepNodeIndex)>
             18: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::analysis, rustc_query_impl::plumbing::QueryCtxt>
             19: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::analysis
             20: <rustc_interface::queries::QueryResult<&rustc_middle::ty::context::GlobalCtxt>>::enter::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}::{closure#2}::{closure#4}>
             21: <rustc_interface::interface::Compiler>::enter::<rustc_driver_impl::run_compiler::{closure#1}::{closure#2}, core::result::Result<core::option::Option<rustc_interface::queries::Linker>, rustc_span::ErrorGuaranteed>>
             22: rustc_span::with_source_map::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
             23: std::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
             24: <<std::thread::Builder>::spawn_unchecked_<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#1} as core::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
             25: std::sys::unix::thread::Thread::new::thread_start
             26: __pthread_start
           

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.70.0-nightly (17c116721 2023-03-29) running on x86_64-apple-darwin

note: compiler flags: --crate-type bin -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:
end of query stack
error: could not compile `ice` (bin "ice")

Backtrace

   Compiling ice v0.1.0 (/Users/zippeykeys12/Documents/ice)
error: internal compiler error: no errors encountered even though `delay_span_bug` issued

error: internal compiler error: unexpected non-GAT usage of an anon const
  --> ice.rs:19:24
   |
19 |     let a = Foo::Bar::<10usize>::new();
   |                        ^^^^^^^
   |
   = note: delayed at    0: std::backtrace::Backtrace::create
              1: std::backtrace::Backtrace::force_capture
              2: <rustc_errors::HandlerInner>::emit_diagnostic
              3: <rustc_errors::Handler>::delay_span_bug::<rustc_span::span_encoding::Span, &str>
              4: rustc_hir_analysis::collect::type_of::opt_const_param_of
              5: <rustc_middle::dep_graph::dep_node::DepKind as rustc_query_system::dep_graph::DepKind>::with_deps::<<rustc_query_system::dep_graph::graph::DepGraphData<rustc_middle::dep_graph::dep_node::DepKind>>::with_task<(rustc_query_impl::plumbing::QueryCtxt, rustc_query_impl::queries::opt_const_param_of), rustc_span::def_id::LocalDefId, core::option::Option<rustc_span::def_id::DefId>>::{closure#0}, core::option::Option<rustc_span::def_id::DefId>>
              6: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<rustc_query_system::query::plumbing::execute_job_incr<rustc_query_impl::queries::opt_const_param_of, rustc_query_impl::plumbing::QueryCtxt>::{closure#2}, (core::option::Option<rustc_span::def_id::DefId>, rustc_query_system::dep_graph::graph::DepNodeIndex)>::{closure#0}, (core::option::Option<rustc_span::def_id::DefId>, rustc_query_system::dep_graph::graph::DepNodeIndex)>
              7: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::opt_const_param_of, rustc_query_impl::plumbing::QueryCtxt>
              8: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::opt_const_param_of
              9: rustc_hir_typeck::typeck
             10: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<rustc_query_system::query::plumbing::execute_job_incr<rustc_query_impl::queries::typeck, rustc_query_impl::plumbing::QueryCtxt>::{closure#2}, (&rustc_middle::ty::typeck_results::TypeckResults, rustc_query_system::dep_graph::graph::DepNodeIndex)>::{closure#0}, (&rustc_middle::ty::typeck_results::TypeckResults, rustc_query_system::dep_graph::graph::DepNodeIndex)>
             11: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::typeck, rustc_query_impl::plumbing::QueryCtxt>
             12: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::typeck
             13: rustc_data_structures::sync::par_for_each_in::<&[rustc_span::def_id::LocalDefId], <rustc_middle::hir::map::Map>::par_body_owners<rustc_hir_typeck::typeck_item_bodies::{closure#0}>::{closure#0}>
             14: rustc_hir_typeck::typeck_item_bodies
             15: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<rustc_query_system::query::plumbing::execute_job_incr<rustc_query_impl::queries::typeck_item_bodies, rustc_query_impl::plumbing::QueryCtxt>::{closure#2}, ((), rustc_query_system::dep_graph::graph::DepNodeIndex)>::{closure#0}, ((), rustc_query_system::dep_graph::graph::DepNodeIndex)>
             16: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::typeck_item_bodies, rustc_query_impl::plumbing::QueryCtxt>
             17: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::typeck_item_bodies
             18: <rustc_session::session::Session>::time::<(), rustc_hir_analysis::check_crate::{closure#7}>
             19: rustc_hir_analysis::check_crate
             20: rustc_interface::passes::analysis
             21: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<rustc_query_system::query::plumbing::execute_job_incr<rustc_query_impl::queries::analysis, rustc_query_impl::plumbing::QueryCtxt>::{closure#2}, (core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_query_system::dep_graph::graph::DepNodeIndex)>::{closure#0}, (core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_query_system::dep_graph::graph::DepNodeIndex)>
             22: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::analysis, rustc_query_impl::plumbing::QueryCtxt>
             23: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::analysis
             24: <rustc_interface::queries::QueryResult<&rustc_middle::ty::context::GlobalCtxt>>::enter::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}::{closure#2}::{closure#4}>
             25: <rustc_interface::interface::Compiler>::enter::<rustc_driver_impl::run_compiler::{closure#1}::{closure#2}, core::result::Result<core::option::Option<rustc_interface::queries::Linker>, rustc_span::ErrorGuaranteed>>
             26: rustc_span::with_source_map::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
             27: std::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
             28: <<std::thread::Builder>::spawn_unchecked_<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#1} as core::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
             29: std::sys::unix::thread::Thread::new::thread_start
             30: __pthread_start
           

error: internal compiler error: unexpected const parent in type_of(): Ty(Ty { hir_id: HirId(DefId(0:17 ~ ice[bc62]::main).9), kind: Path(TypeRelative(Ty { hir_id: HirId(DefId(0:17 ~ ice[bc62]::main).5), kind: Path(Resolved(None, Path { span: ice.rs:19:13: 19:16 (#0), res: Def(Struct, DefId(0:3 ~ ice[bc62]::Foo)), segments: [PathSegment { ident: Foo#0, hir_id: HirId(DefId(0:17 ~ ice[bc62]::main).4), res: Def(Struct, DefId(0:3 ~ ice[bc62]::Foo)), args: None, infer_args: true }] })), span: ice.rs:19:13: 19:16 (#0) }, PathSegment { ident: Bar#0, hir_id: HirId(DefId(0:17 ~ ice[bc62]::main).8), res: Err, args: Some(GenericArgs { args: [Const(ConstArg { value: AnonConst { hir_id: HirId(DefId(0:17 ~ ice[bc62]::main).6), def_id: DefId(0:18 ~ ice[bc62]::main::{constant#0}), body: BodyId { hir_id: HirId(DefId(0:17 ~ ice[bc62]::main).7) } }, span: ice.rs:19:24: 19:31 (#0) })], bindings: [], parenthesized: false, span_ext: ice.rs:19:23: 19:32 (#0) }), infer_args: false })), span: ice.rs:19:13: 19:32 (#0) })
  |
  = note: delayed at    0: std::backtrace::Backtrace::create
             1: std::backtrace::Backtrace::force_capture
             2: <rustc_errors::HandlerInner>::emit_diagnostic
             3: <rustc_errors::Handler>::delay_span_bug::<rustc_span::span_encoding::Span, &str>
             4: rustc_hir_analysis::collect::type_of::type_of
             5: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<rustc_query_system::query::plumbing::execute_job_incr<rustc_query_impl::queries::type_of, rustc_query_impl::plumbing::QueryCtxt>::{closure#2}, (rustc_middle::ty::subst::EarlyBinder<rustc_middle::ty::Ty>, rustc_query_system::dep_graph::graph::DepNodeIndex)>::{closure#0}, (rustc_middle::ty::subst::EarlyBinder<rustc_middle::ty::Ty>, rustc_query_system::dep_graph::graph::DepNodeIndex)>
             6: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::type_of, rustc_query_impl::plumbing::QueryCtxt>
             7: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::type_of
             8: rustc_hir_typeck::typeck
             9: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<rustc_query_system::query::plumbing::execute_job_incr<rustc_query_impl::queries::typeck, rustc_query_impl::plumbing::QueryCtxt>::{closure#2}, (&rustc_middle::ty::typeck_results::TypeckResults, rustc_query_system::dep_graph::graph::DepNodeIndex)>::{closure#0}, (&rustc_middle::ty::typeck_results::TypeckResults, rustc_query_system::dep_graph::graph::DepNodeIndex)>
            10: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::typeck, rustc_query_impl::plumbing::QueryCtxt>
            11: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::typeck
            12: rustc_data_structures::sync::par_for_each_in::<&[rustc_span::def_id::LocalDefId], <rustc_middle::hir::map::Map>::par_body_owners<rustc_hir_typeck::typeck_item_bodies::{closure#0}>::{closure#0}>
            13: rustc_hir_typeck::typeck_item_bodies
            14: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<rustc_query_system::query::plumbing::execute_job_incr<rustc_query_impl::queries::typeck_item_bodies, rustc_query_impl::plumbing::QueryCtxt>::{closure#2}, ((), rustc_query_system::dep_graph::graph::DepNodeIndex)>::{closure#0}, ((), rustc_query_system::dep_graph::graph::DepNodeIndex)>
            15: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::typeck_item_bodies, rustc_query_impl::plumbing::QueryCtxt>
            16: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::typeck_item_bodies
            17: <rustc_session::session::Session>::time::<(), rustc_hir_analysis::check_crate::{closure#7}>
            18: rustc_hir_analysis::check_crate
            19: rustc_interface::passes::analysis
            20: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<rustc_query_system::query::plumbing::execute_job_incr<rustc_query_impl::queries::analysis, rustc_query_impl::plumbing::QueryCtxt>::{closure#2}, (core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_query_system::dep_graph::graph::DepNodeIndex)>::{closure#0}, (core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_query_system::dep_graph::graph::DepNodeIndex)>
            21: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::analysis, rustc_query_impl::plumbing::QueryCtxt>
            22: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::analysis
            23: <rustc_interface::queries::QueryResult<&rustc_middle::ty::context::GlobalCtxt>>::enter::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}::{closure#2}::{closure#4}>
            24: <rustc_interface::interface::Compiler>::enter::<rustc_driver_impl::run_compiler::{closure#1}::{closure#2}, core::result::Result<core::option::Option<rustc_interface::queries::Linker>, rustc_span::ErrorGuaranteed>>
            25: rustc_span::with_source_map::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
            26: std::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
            27: <<std::thread::Builder>::spawn_unchecked_<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#1} as core::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
            28: std::sys::unix::thread::Thread::new::thread_start
            29: __pthread_start
          

error: internal compiler error: mir_const_qualif: MIR had errors
  --> ice.rs:19:24
   |
19 |     let a = Foo::Bar::<10usize>::new();
   |                        ^^^^^^^
   |
   = note: delayed at    0: std::backtrace::Backtrace::create
              1: std::backtrace::Backtrace::force_capture
              2: <rustc_errors::HandlerInner>::emit_diagnostic
              3: <rustc_errors::Handler>::delay_span_bug::<rustc_span::span_encoding::Span, &str>
              4: rustc_mir_transform::mir_const_qualif
              5: <rustc_mir_transform::provide::{closure#0} as core::ops::function::FnOnce<(rustc_middle::ty::context::TyCtxt, rustc_span::def_id::LocalDefId)>>::call_once
              6: <rustc_middle::dep_graph::dep_node::DepKind as rustc_query_system::dep_graph::DepKind>::with_deps::<<rustc_query_system::dep_graph::graph::DepGraphData<rustc_middle::dep_graph::dep_node::DepKind>>::with_task<(rustc_query_impl::plumbing::QueryCtxt, rustc_query_impl::queries::mir_const_qualif), rustc_span::def_id::DefId, rustc_middle::mir::query::ConstQualifs>::{closure#0}, rustc_middle::mir::query::ConstQualifs>
              7: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<rustc_query_system::query::plumbing::execute_job_incr<rustc_query_impl::queries::mir_const_qualif, rustc_query_impl::plumbing::QueryCtxt>::{closure#2}, (rustc_middle::mir::query::ConstQualifs, rustc_query_system::dep_graph::graph::DepNodeIndex)>::{closure#0}, (rustc_middle::mir::query::ConstQualifs, rustc_query_system::dep_graph::graph::DepNodeIndex)>
              8: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::mir_const_qualif, rustc_query_impl::plumbing::QueryCtxt>
              9: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::mir_const_qualif
             10: rustc_mir_transform::mir_promoted
             11: <rustc_query_system::query::plumbing::execute_job_incr<rustc_query_impl::queries::mir_promoted, rustc_query_impl::plumbing::QueryCtxt>::{closure#2}::{closure#2} as core::ops::function::FnOnce<((rustc_query_impl::plumbing::QueryCtxt, rustc_query_impl::queries::mir_promoted), rustc_middle::ty::WithOptConstParam<rustc_span::def_id::LocalDefId>)>>::call_once
             12: <rustc_middle::dep_graph::dep_node::DepKind as rustc_query_system::dep_graph::DepKind>::with_deps::<<rustc_query_system::dep_graph::graph::DepGraphData<rustc_middle::dep_graph::dep_node::DepKind>>::with_task<(rustc_query_impl::plumbing::QueryCtxt, rustc_query_impl::queries::mir_promoted), 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>>)>::{closure#0}, (&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>>)>
             13: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<rustc_query_system::query::plumbing::execute_job_incr<rustc_query_impl::queries::mir_promoted, rustc_query_impl::plumbing::QueryCtxt>::{closure#2}, ((&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>>), rustc_query_system::dep_graph::graph::DepNodeIndex)>::{closure#0}, ((&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>>), rustc_query_system::dep_graph::graph::DepNodeIndex)>
             14: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::mir_promoted, rustc_query_impl::plumbing::QueryCtxt>
             15: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::mir_promoted
             16: rustc_borrowck::mir_borrowck
             17: <rustc_borrowck::provide::{closure#0} as core::ops::function::FnOnce<(rustc_middle::ty::context::TyCtxt, rustc_span::def_id::LocalDefId)>>::call_once
             18: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<rustc_query_system::query::plumbing::execute_job_incr<rustc_query_impl::queries::mir_borrowck, rustc_query_impl::plumbing::QueryCtxt>::{closure#2}, (&rustc_middle::mir::query::BorrowCheckResult, rustc_query_system::dep_graph::graph::DepNodeIndex)>::{closure#0}, (&rustc_middle::mir::query::BorrowCheckResult, rustc_query_system::dep_graph::graph::DepNodeIndex)>
             19: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::mir_borrowck, rustc_query_impl::plumbing::QueryCtxt>
             20: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::mir_borrowck
             21: rustc_data_structures::sync::par_for_each_in::<&[rustc_span::def_id::LocalDefId], <rustc_middle::hir::map::Map>::par_body_owners<rustc_interface::passes::analysis::{closure#2}::{closure#0}>::{closure#0}>
             22: <rustc_session::session::Session>::time::<(), rustc_interface::passes::analysis::{closure#2}>
             23: rustc_interface::passes::analysis
             24: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<rustc_query_system::query::plumbing::execute_job_incr<rustc_query_impl::queries::analysis, rustc_query_impl::plumbing::QueryCtxt>::{closure#2}, (core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_query_system::dep_graph::graph::DepNodeIndex)>::{closure#0}, (core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_query_system::dep_graph::graph::DepNodeIndex)>
             25: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::analysis, rustc_query_impl::plumbing::QueryCtxt>
             26: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::analysis
             27: <rustc_interface::queries::QueryResult<&rustc_middle::ty::context::GlobalCtxt>>::enter::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}::{closure#2}::{closure#4}>
             28: <rustc_interface::interface::Compiler>::enter::<rustc_driver_impl::run_compiler::{closure#1}::{closure#2}, core::result::Result<core::option::Option<rustc_interface::queries::Linker>, rustc_span::ErrorGuaranteed>>
             29: rustc_span::with_source_map::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
             30: std::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
             31: <<std::thread::Builder>::spawn_unchecked_<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#1} as core::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
             32: std::sys::unix::thread::Thread::new::thread_start
             33: __pthread_start
           

error: internal compiler error: broken MIR in DefId(0:18 ~ ice[bc62]::main::{constant#0}) ("return type"): bad type [type error]
  --> ice.rs:19:24
   |
19 |     let a = Foo::Bar::<10usize>::new();
   |                        ^^^^^^^
   |
   = note: delayed at    0: std::backtrace::Backtrace::create
              1: std::backtrace::Backtrace::force_capture
              2: <rustc_errors::HandlerInner>::emit_diagnostic
              3: <rustc_errors::Handler>::delay_span_bug::<rustc_span::span_encoding::Span, &str>
              4: <rustc_borrowck::type_check::TypeVerifier>::sanitize_type
              5: <rustc_borrowck::type_check::TypeVerifier as rustc_middle::mir::visit::Visitor>::visit_body
              6: rustc_borrowck::type_check::type_check
              7: rustc_borrowck::nll::compute_regions
              8: rustc_borrowck::do_mir_borrowck
              9: rustc_borrowck::mir_borrowck
             10: <rustc_borrowck::provide::{closure#0} as core::ops::function::FnOnce<(rustc_middle::ty::context::TyCtxt, rustc_span::def_id::LocalDefId)>>::call_once
             11: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<rustc_query_system::query::plumbing::execute_job_incr<rustc_query_impl::queries::mir_borrowck, rustc_query_impl::plumbing::QueryCtxt>::{closure#2}, (&rustc_middle::mir::query::BorrowCheckResult, rustc_query_system::dep_graph::graph::DepNodeIndex)>::{closure#0}, (&rustc_middle::mir::query::BorrowCheckResult, rustc_query_system::dep_graph::graph::DepNodeIndex)>
             12: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::mir_borrowck, rustc_query_impl::plumbing::QueryCtxt>
             13: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::mir_borrowck
             14: rustc_data_structures::sync::par_for_each_in::<&[rustc_span::def_id::LocalDefId], <rustc_middle::hir::map::Map>::par_body_owners<rustc_interface::passes::analysis::{closure#2}::{closure#0}>::{closure#0}>
             15: <rustc_session::session::Session>::time::<(), rustc_interface::passes::analysis::{closure#2}>
             16: rustc_interface::passes::analysis
             17: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<rustc_query_system::query::plumbing::execute_job_incr<rustc_query_impl::queries::analysis, rustc_query_impl::plumbing::QueryCtxt>::{closure#2}, (core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_query_system::dep_graph::graph::DepNodeIndex)>::{closure#0}, (core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_query_system::dep_graph::graph::DepNodeIndex)>
             18: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::analysis, rustc_query_impl::plumbing::QueryCtxt>
             19: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::analysis
             20: <rustc_interface::queries::QueryResult<&rustc_middle::ty::context::GlobalCtxt>>::enter::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}::{closure#2}::{closure#4}>
             21: <rustc_interface::interface::Compiler>::enter::<rustc_driver_impl::run_compiler::{closure#1}::{closure#2}, core::result::Result<core::option::Option<rustc_interface::queries::Linker>, rustc_span::ErrorGuaranteed>>
             22: rustc_span::with_source_map::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
             23: std::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
             24: <<std::thread::Builder>::spawn_unchecked_<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#1} as core::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
             25: std::sys::unix::thread::Thread::new::thread_start
             26: __pthread_start
           

error: internal compiler error: TyKind::Error constructed but no error reported
  |
  = note: delayed at    0: std::backtrace::Backtrace::create
             1: std::backtrace::Backtrace::force_capture
             2: <rustc_errors::HandlerInner>::emit_diagnostic
             3: <rustc_errors::Handler>::delay_span_bug::<rustc_span::span_encoding::Span, &str>
             4: <rustc_borrowck::type_check::TypeVerifier>::sanitize_type
             5: <rustc_borrowck::type_check::TypeVerifier as rustc_middle::mir::visit::Visitor>::visit_body
             6: rustc_borrowck::type_check::type_check
             7: rustc_borrowck::nll::compute_regions
             8: rustc_borrowck::do_mir_borrowck
             9: rustc_borrowck::mir_borrowck
            10: <rustc_borrowck::provide::{closure#0} as core::ops::function::FnOnce<(rustc_middle::ty::context::TyCtxt, rustc_span::def_id::LocalDefId)>>::call_once
            11: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<rustc_query_system::query::plumbing::execute_job_incr<rustc_query_impl::queries::mir_borrowck, rustc_query_impl::plumbing::QueryCtxt>::{closure#2}, (&rustc_middle::mir::query::BorrowCheckResult, rustc_query_system::dep_graph::graph::DepNodeIndex)>::{closure#0}, (&rustc_middle::mir::query::BorrowCheckResult, rustc_query_system::dep_graph::graph::DepNodeIndex)>
            12: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::mir_borrowck, rustc_query_impl::plumbing::QueryCtxt>
            13: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::mir_borrowck
            14: rustc_data_structures::sync::par_for_each_in::<&[rustc_span::def_id::LocalDefId], <rustc_middle::hir::map::Map>::par_body_owners<rustc_interface::passes::analysis::{closure#2}::{closure#0}>::{closure#0}>
            15: <rustc_session::session::Session>::time::<(), rustc_interface::passes::analysis::{closure#2}>
            16: rustc_interface::passes::analysis
            17: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<rustc_query_system::query::plumbing::execute_job_incr<rustc_query_impl::queries::analysis, rustc_query_impl::plumbing::QueryCtxt>::{closure#2}, (core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_query_system::dep_graph::graph::DepNodeIndex)>::{closure#0}, (core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_query_system::dep_graph::graph::DepNodeIndex)>
            18: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::analysis, rustc_query_impl::plumbing::QueryCtxt>
            19: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::analysis
            20: <rustc_interface::queries::QueryResult<&rustc_middle::ty::context::GlobalCtxt>>::enter::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}::{closure#2}::{closure#4}>
            21: <rustc_interface::interface::Compiler>::enter::<rustc_driver_impl::run_compiler::{closure#1}::{closure#2}, core::result::Result<core::option::Option<rustc_interface::queries::Linker>, rustc_span::ErrorGuaranteed>>
            22: rustc_span::with_source_map::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
            23: std::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
            24: <<std::thread::Builder>::spawn_unchecked_<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#1} as core::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
            25: std::sys::unix::thread::Thread::new::thread_start
            26: __pthread_start
          

error: internal compiler error: broken MIR in DefId(0:18 ~ ice[bc62]::main::{constant#0}) (LocalDecl { mutability: Mut, local_info: Set(Boring), internal: false, ty: [type error], user_ty: None, source_info: SourceInfo { span: ice.rs:19:24: 19:31 (#0), scope: scope[0] } }): bad type [type error]
  --> ice.rs:19:24
   |
19 |     let a = Foo::Bar::<10usize>::new();
   |                        ^^^^^^^
   |
   = note: delayed at    0: std::backtrace::Backtrace::create
              1: std::backtrace::Backtrace::force_capture
              2: <rustc_errors::HandlerInner>::emit_diagnostic
              3: <rustc_errors::Handler>::delay_span_bug::<rustc_span::span_encoding::Span, &str>
              4: <rustc_borrowck::type_check::TypeVerifier>::sanitize_type
              5: <rustc_borrowck::type_check::TypeVerifier as rustc_middle::mir::visit::Visitor>::visit_body
              6: rustc_borrowck::type_check::type_check
              7: rustc_borrowck::nll::compute_regions
              8: rustc_borrowck::do_mir_borrowck
              9: rustc_borrowck::mir_borrowck
             10: <rustc_borrowck::provide::{closure#0} as core::ops::function::FnOnce<(rustc_middle::ty::context::TyCtxt, rustc_span::def_id::LocalDefId)>>::call_once
             11: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<rustc_query_system::query::plumbing::execute_job_incr<rustc_query_impl::queries::mir_borrowck, rustc_query_impl::plumbing::QueryCtxt>::{closure#2}, (&rustc_middle::mir::query::BorrowCheckResult, rustc_query_system::dep_graph::graph::DepNodeIndex)>::{closure#0}, (&rustc_middle::mir::query::BorrowCheckResult, rustc_query_system::dep_graph::graph::DepNodeIndex)>
             12: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::mir_borrowck, rustc_query_impl::plumbing::QueryCtxt>
             13: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::mir_borrowck
             14: rustc_data_structures::sync::par_for_each_in::<&[rustc_span::def_id::LocalDefId], <rustc_middle::hir::map::Map>::par_body_owners<rustc_interface::passes::analysis::{closure#2}::{closure#0}>::{closure#0}>
             15: <rustc_session::session::Session>::time::<(), rustc_interface::passes::analysis::{closure#2}>
             16: rustc_interface::passes::analysis
             17: <std::thread::local::LocalKey<core::cell::Cell<*const ()>>>::with::<rustc_middle::ty::context::tls::enter_context<rustc_query_system::query::plumbing::execute_job_incr<rustc_query_impl::queries::analysis, rustc_query_impl::plumbing::QueryCtxt>::{closure#2}, (core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_query_system::dep_graph::graph::DepNodeIndex)>::{closure#0}, (core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_query_system::dep_graph::graph::DepNodeIndex)>
             18: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::queries::analysis, rustc_query_impl::plumbing::QueryCtxt>
             19: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::analysis
             20: <rustc_interface::queries::QueryResult<&rustc_middle::ty::context::GlobalCtxt>>::enter::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}::{closure#2}::{closure#4}>
             21: <rustc_interface::interface::Compiler>::enter::<rustc_driver_impl::run_compiler::{closure#1}::{closure#2}, core::result::Result<core::option::Option<rustc_interface::queries::Linker>, rustc_span::ErrorGuaranteed>>
             22: rustc_span::with_source_map::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
             23: std::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
             24: <<std::thread::Builder>::spawn_unchecked_<rustc_interface::util::run_in_thread_pool_with_globals<rustc_interface::interface::run_compiler<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#1}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#1} as core::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
             25: std::sys::unix::thread::Thread::new::thread_start
             26: __pthread_start
           

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.70.0-nightly (17c116721 2023-03-29) running on x86_64-apple-darwin

note: compiler flags: --crate-type bin -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:
end of query stack
error: could not compile `ice` (bin "ice")

@ZippeyKeys12 ZippeyKeys12 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 30, 2023
@matthiaskrgr
Copy link
Member

searched toolchains nightly-2022-11-03 through nightly-2023-03-31


Regression in nightly-2022-11-06


Regression in 452cf4f

Regression in #103621

@fmease
Copy link
Member

fmease commented Apr 5, 2023

@rustbot label F-inherent_associated_types
@rustbot claim

@rustbot rustbot added the F-inherent_associated_types `#![feature(inherent_associated_types)]` label Apr 5, 2023
@fmease
Copy link
Member

fmease commented Apr 5, 2023

I've just pushed a commit to #109410 that will fix this issue.

I used 10usize since just 10 gave a cannot infer type for type `{integer}` error.

Thanks for mentioning. That's just an artifact.

@jyn514 jyn514 changed the title Inherent associated type with const generic results in ICE ICE: 'unexpected non-GAT usage of an anon const' when using Inherent associated type with const generic Apr 7, 2023
@rust-lang-glacier-bot rust-lang-glacier-bot added the glacier ICE tracked in rust-lang/glacier. label Apr 7, 2023
@JohnTitor
Copy link
Member

Triage: this is no longer ICE since today's nightly.
@rustbot label: +E-needs-test

@rustbot rustbot 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 22, 2023
@bors bors closed this as completed in 8c0dfa3 Apr 26, 2023
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. F-inherent_associated_types `#![feature(inherent_associated_types)]` 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

Successfully merging a pull request may close this issue.

6 participants