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 type encountered in variance inference: _ #109071

Closed
matthiaskrgr opened this issue Mar 13, 2023 · 4 comments · Fixed by #113030
Closed

ICE: unexpected type encountered in variance inference: _ #109071

matthiaskrgr opened this issue Mar 13, 2023 · 4 comments · Fixed by #113030
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. glacier ICE tracked in rust-lang/glacier. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ S-has-mcve Status: A Minimal Complete and Verifiable Example has been found for this issue T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@matthiaskrgr
Copy link
Member

Code

pub trait Iter {
    type Item<'a> where Self: 'a;

    fn next<'a>(&'a mut self) -> Option<Windows<T>>;

    fn for_each<F>(&'a mut self, mut f: F)
        where Self: Sized, F: for<'a> FnMut(Self::Windows<'a>)
    {
      todo!()
    }
}

pub struct Windows<T> {}

impl<T> Windows<'a> {
    type Item<'a> where T: 'a = &'a mut [T];

    fn next<'a>(&'a mut self) -> Option<Self::Item<'a>> {
        todo!();
    }
}

impl<T> Iter for Windows<T> {

    fn T<'a>(&'for_each mut self) -> Option<Self::Item<'a>> {
        todo!();
    }
}

Meta

rustc --version --verbose:

rustc 1.70.0-nightly (7b4f48927 2023-03-12)
binary: rustc
commit-hash: 7b4f48927dce585f747a58083b45ab62b9d73a53
commit-date: 2023-03-12
host: x86_64-unknown-linux-gnu
release: 1.70.0-nightly
LLVM version: 15.0.7

Error output

error[E0261]: use of undeclared lifetime name `'a`
 --> 48.rs:6:21
  |
6 |     fn for_each<F>(&'a mut self, mut f: F)
  |                     ^^ undeclared lifetime
  |
help: consider introducing lifetime `'a` here
  |
6 |     fn for_each<'a, F>(&'a mut self, mut f: F)
  |                 +++
help: consider introducing lifetime `'a` here
  |
1 | pub trait Iter<'a> {
  |               ++++

error[E0261]: use of undeclared lifetime name `'a`
  --> 48.rs:15:17
   |
15 | impl<T> Windows<'a> {
   |      -          ^^ undeclared lifetime
   |      |
   |      help: consider introducing lifetime `'a` here: `'a,`

error[E0407]: method `T` is not a member of trait `Iter`
  --> 48.rs:25:5
   |
25 | /     fn T<'a>(&'for_each mut self) -> Option<Self::Item<'a>> {
26 | |         todo!();
27 | |     }
   | |_____^ not a member of trait `Iter`

error[E0261]: use of undeclared lifetime name `'for_each`
  --> 48.rs:25:15
   |
25 |     fn T<'a>(&'for_each mut self) -> Option<Self::Item<'a>> {
   |               ^^^^^^^^^ undeclared lifetime
   |
help: consider introducing lifetime `'for_each` here
   |
25 |     fn T<'for_each, 'a>(&'for_each mut self) -> Option<Self::Item<'a>> {
   |          ++++++++++
help: consider introducing lifetime `'for_each` here
   |
23 | impl<'for_each, T> Iter for Windows<T> {
   |      ++++++++++

error[E0412]: cannot find type `T` in this scope
 --> 48.rs:4:49
  |
4 |     fn next<'a>(&'a mut self) -> Option<Windows<T>>;
  |                                                 ^ not found in this scope

warning: where clause not allowed here
  --> 48.rs:16:19
   |
16 |     type Item<'a> where T: 'a = &'a mut [T];
   |                   ^^^^^^^^^^^
   |
   = note: see issue #89122 <https://github.com/rust-lang/rust/issues/89122> for more information
   = note: `#[warn(deprecated_where_clause_location)]` on by default
help: move it to the end of the type declaration
   |
16 -     type Item<'a> where T: 'a = &'a mut [T];
16 +     type Item<'a>  = &'a mut [T] where T: 'a;
   |

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

error[E0107]: struct takes 0 lifetime arguments but 1 lifetime argument was supplied
  --> 48.rs:15:9
   |
15 | impl<T> Windows<'a> {
   |         ^^^^^^^---- help: remove these generics
   |         |
   |         expected 0 lifetime arguments
   |
note: struct defined here, with 0 lifetime parameters
  --> 48.rs:13:12
   |
13 | pub struct Windows<T> {}
   |            ^^^^^^^

error[E0107]: struct takes 1 generic argument but 0 generic arguments were supplied
  --> 48.rs:15:9
   |
15 | impl<T> Windows<'a> {
   |         ^^^^^^^ expected 1 generic argument
   |
note: struct defined here, with 1 generic parameter: `T`
  --> 48.rs:13:12
   |
13 | pub struct Windows<T> {}
   |            ^^^^^^^ -
help: add missing generic argument
   |
15 | impl<T> Windows<'a, T> {
   |                   +++

error[E0220]: associated type `Windows` not found for `Self`
 --> 48.rs:7:51
  |
7 |         where Self: Sized, F: for<'a> FnMut(Self::Windows<'a>)
  |                                                   ^^^^^^^ associated type `Windows` not found

error[E0658]: inherent associated types are unstable
  --> 48.rs:16:5
   |
16 |     type Item<'a> where T: 'a = &'a mut [T];
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: see issue #8995 <https://github.com/rust-lang/rust/issues/8995> for more information
   = help: add `#![feature(inherent_associated_types)]` to the crate attributes to enable
Backtrace

error: internal compiler error: compiler/rustc_hir_analysis/src/variance/constraints.rs:301:17: unexpected type encountered in variance inference: _

thread 'rustc' panicked at 'Box<dyn Any>', /rustc/7b4f48927dce585f747a58083b45ab62b9d73a53/compiler/rustc_errors/src/lib.rs:1644:9
stack backtrace:
   0:     0x7f8c0716651a - std::backtrace_rs::backtrace::libunwind::trace::hf7d75cca16fd1b61
                               at /rustc/7b4f48927dce585f747a58083b45ab62b9d73a53/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7f8c0716651a - std::backtrace_rs::backtrace::trace_unsynchronized::hf5ec95734aab509d
                               at /rustc/7b4f48927dce585f747a58083b45ab62b9d73a53/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f8c0716651a - std::sys_common::backtrace::_print_fmt::he95113413355c8cd
                               at /rustc/7b4f48927dce585f747a58083b45ab62b9d73a53/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x7f8c0716651a - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h072d12f2e69ca92b
                               at /rustc/7b4f48927dce585f747a58083b45ab62b9d73a53/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7f8c071c9c5e - core::fmt::write::h1d23f16415e96af2
                               at /rustc/7b4f48927dce585f747a58083b45ab62b9d73a53/library/core/src/fmt/mod.rs:1232:17
   5:     0x7f8c07159275 - std::io::Write::write_fmt::hcf1e413fde4ffcd5
                               at /rustc/7b4f48927dce585f747a58083b45ab62b9d73a53/library/std/src/io/mod.rs:1684:15
   6:     0x7f8c071662e5 - std::sys_common::backtrace::_print::h6b2b14bedd5177e7
                               at /rustc/7b4f48927dce585f747a58083b45ab62b9d73a53/library/std/src/sys_common/backtrace.rs:47:5
   7:     0x7f8c071662e5 - std::sys_common::backtrace::print::h09ccebfbcd382e89
                               at /rustc/7b4f48927dce585f747a58083b45ab62b9d73a53/library/std/src/sys_common/backtrace.rs:34:9
   8:     0x7f8c0716905f - std::panicking::default_hook::{{closure}}::h4ee055db778febc2
                               at /rustc/7b4f48927dce585f747a58083b45ab62b9d73a53/library/std/src/panicking.rs:271:22
   9:     0x7f8c07168d9b - std::panicking::default_hook::ha74f60e3a15d95fb
                               at /rustc/7b4f48927dce585f747a58083b45ab62b9d73a53/library/std/src/panicking.rs:290:9
  10:     0x7f8c0a497085 - rustc_driver_impl[d355a67661263e47]::DEFAULT_HOOK::{closure#0}::{closure#0}
  11:     0x7f8c0716989d - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h7f34603beb945e8f
                               at /rustc/7b4f48927dce585f747a58083b45ab62b9d73a53/library/alloc/src/boxed.rs:2002:9
  12:     0x7f8c0716989d - std::panicking::rust_panic_with_hook::h4b5d379936d4932f
                               at /rustc/7b4f48927dce585f747a58083b45ab62b9d73a53/library/std/src/panicking.rs:696:13
  13:     0x7f8c0aa02371 - std[e52d7c968ed01318]::panicking::begin_panic::<rustc_errors[45159b7f7e36021d]::ExplicitBug>::{closure#0}
  14:     0x7f8c0a9fdaa6 - std[e52d7c968ed01318]::sys_common::backtrace::__rust_end_short_backtrace::<std[e52d7c968ed01318]::panicking::begin_panic<rustc_errors[45159b7f7e36021d]::ExplicitBug>::{closure#0}, !>
  15:     0x7f8c0aa86046 - std[e52d7c968ed01318]::panicking::begin_panic::<rustc_errors[45159b7f7e36021d]::ExplicitBug>
  16:     0x7f8c0aa51e06 - std[e52d7c968ed01318]::panic::panic_any::<rustc_errors[45159b7f7e36021d]::ExplicitBug>
  17:     0x7f8c0aa4d966 - <rustc_errors[45159b7f7e36021d]::HandlerInner>::bug::<&alloc[fc860cae0dfa1ab1]::string::String>
  18:     0x7f8c0aa4d630 - <rustc_errors[45159b7f7e36021d]::Handler>::bug::<&alloc[fc860cae0dfa1ab1]::string::String>
  19:     0x7f8c0aa39a9b - rustc_middle[a96ac5d591578447]::util::bug::opt_span_bug_fmt::<rustc_span[f8bdfaef83e46314]::span_encoding::Span>::{closure#0}
  20:     0x7f8c0aa384fa - rustc_middle[a96ac5d591578447]::ty::context::tls::with_opt::<rustc_middle[a96ac5d591578447]::util::bug::opt_span_bug_fmt<rustc_span[f8bdfaef83e46314]::span_encoding::Span>::{closure#0}, !>::{closure#0}
  21:     0x7f8c0aa384c6 - rustc_middle[a96ac5d591578447]::ty::context::tls::with_context_opt::<rustc_middle[a96ac5d591578447]::ty::context::tls::with_opt<rustc_middle[a96ac5d591578447]::util::bug::opt_span_bug_fmt<rustc_span[f8bdfaef83e46314]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
  22:     0x7f8c0aa399e6 - rustc_middle[a96ac5d591578447]::util::bug::opt_span_bug_fmt::<rustc_span[f8bdfaef83e46314]::span_encoding::Span>
  23:     0x7f8c08ab44b3 - rustc_middle[a96ac5d591578447]::util::bug::bug_fmt
  24:     0x7f8c08c3e6bd - <rustc_hir_analysis[357075c2c3fc2a7b]::variance::constraints::ConstraintContext>::add_constraints_from_ty
  25:     0x7f8c08c3dc69 - <rustc_hir_analysis[357075c2c3fc2a7b]::variance::constraints::ConstraintContext>::add_constraints_from_ty
  26:     0x7f8c08c3d247 - <rustc_hir_analysis[357075c2c3fc2a7b]::variance::constraints::ConstraintContext>::build_constraints_for_item
  27:     0x7f8c08c3cc9a - rustc_hir_analysis[357075c2c3fc2a7b]::variance::constraints::add_constraints_from_crate
  28:     0x7f8c08c3c123 - rustc_hir_analysis[357075c2c3fc2a7b]::variance::crate_variances
  29:     0x7f8c09cbe53b - rustc_query_system[704b80a7bc44cd49]::query::plumbing::try_execute_query::<rustc_query_impl[217bee59c5548bf5]::queries::crate_variances, rustc_query_impl[217bee59c5548bf5]::plumbing::QueryCtxt>
  30:     0x7f8c09cbe210 - <rustc_query_impl[217bee59c5548bf5]::Queries as rustc_middle[a96ac5d591578447]::ty::query::QueryEngine>::crate_variances
  31:     0x7f8c0945afcc - rustc_hir_analysis[357075c2c3fc2a7b]::variance::variances_of
  32:     0x7f8c09458cc8 - rustc_query_system[704b80a7bc44cd49]::query::plumbing::try_execute_query::<rustc_query_impl[217bee59c5548bf5]::queries::variances_of, rustc_query_impl[217bee59c5548bf5]::plumbing::QueryCtxt>
  33:     0x7f8c094588bd - <rustc_query_impl[217bee59c5548bf5]::Queries as rustc_middle[a96ac5d591578447]::ty::query::QueryEngine>::variances_of
  34:     0x7f8c0850e26c - rustc_middle[a96ac5d591578447]::ty::relate::super_relate_tys::<rustc_infer[8071ebb96624e335]::infer::sub::Sub>
  35:     0x7f8c0850a261 - <rustc_infer[8071ebb96624e335]::infer::sub::Sub as rustc_middle[a96ac5d591578447]::ty::relate::TypeRelation>::tys
  36:     0x7f8c099e52a3 - <rustc_infer[8071ebb96624e335]::infer::InferCtxt>::commit_if_ok::<rustc_infer[8071ebb96624e335]::infer::InferOk<()>, rustc_middle[a96ac5d591578447]::ty::error::TypeError, <rustc_infer[8071ebb96624e335]::infer::at::Trace>::sub<rustc_middle[a96ac5d591578447]::ty::Ty>::{closure#0}>
  37:     0x7f8c099e50d7 - <rustc_trait_selection[8ee7c2d509810bbf]::traits::engine::ObligationCtxt>::sup::<rustc_middle[a96ac5d591578447]::ty::Ty>
  38:     0x7f8c0a5c340a - <rustc_infer[8071ebb96624e335]::infer::InferCtxt>::probe::<core[125d846441ac421f]::option::Option<(rustc_span[f8bdfaef83e46314]::def_id::DefId, rustc_span[f8bdfaef83e46314]::def_id::DefId, &rustc_middle[a96ac5d591578447]::ty::list::List<rustc_middle[a96ac5d591578447]::ty::subst::GenericArg>)>, <dyn rustc_hir_analysis[357075c2c3fc2a7b]::astconv::AstConv>::lookup_inherent_assoc_ty::{closure#1}::{closure#0}>
  39:     0x7f8c0a5bfba6 - <&mut <dyn rustc_hir_analysis[357075c2c3fc2a7b]::astconv::AstConv>::lookup_inherent_assoc_ty::{closure#1} as core[125d846441ac421f]::ops::function::FnMut<(&(rustc_span[f8bdfaef83e46314]::def_id::DefId, (rustc_span[f8bdfaef83e46314]::def_id::DefId, rustc_span[f8bdfaef83e46314]::def_id::DefId)),)>>::call_mut
  40:     0x7f8c0a605bee - <alloc[fc860cae0dfa1ab1]::vec::Vec<(rustc_span[f8bdfaef83e46314]::def_id::DefId, rustc_span[f8bdfaef83e46314]::def_id::DefId, &rustc_middle[a96ac5d591578447]::ty::list::List<rustc_middle[a96ac5d591578447]::ty::subst::GenericArg>)> as alloc[fc860cae0dfa1ab1]::vec::spec_from_iter::SpecFromIter<(rustc_span[f8bdfaef83e46314]::def_id::DefId, rustc_span[f8bdfaef83e46314]::def_id::DefId, &rustc_middle[a96ac5d591578447]::ty::list::List<rustc_middle[a96ac5d591578447]::ty::subst::GenericArg>), core[125d846441ac421f]::iter::adapters::filter_map::FilterMap<core[125d846441ac421f]::slice::iter::Iter<(rustc_span[f8bdfaef83e46314]::def_id::DefId, (rustc_span[f8bdfaef83e46314]::def_id::DefId, rustc_span[f8bdfaef83e46314]::def_id::DefId))>, <dyn rustc_hir_analysis[357075c2c3fc2a7b]::astconv::AstConv>::lookup_inherent_assoc_ty::{closure#1}>>>::from_iter
  41:     0x7f8c09312a66 - <dyn rustc_hir_analysis[357075c2c3fc2a7b]::astconv::AstConv>::associated_path_to_ty::{closure#0}
  42:     0x7f8c092f75a6 - <dyn rustc_hir_analysis[357075c2c3fc2a7b]::astconv::AstConv>::ast_ty_to_ty_inner::{closure#0}
  43:     0x7f8c092fb21c - <dyn rustc_hir_analysis[357075c2c3fc2a7b]::astconv::AstConv>::res_to_ty
  44:     0x7f8c092f725e - <dyn rustc_hir_analysis[357075c2c3fc2a7b]::astconv::AstConv>::ast_ty_to_ty_inner::{closure#0}
  45:     0x7f8c09390a3b - <dyn rustc_hir_analysis[357075c2c3fc2a7b]::astconv::AstConv>::ty_of_fn::{closure#0}
  46:     0x7f8c09402d35 - rustc_hir_analysis[357075c2c3fc2a7b]::collect::fn_sig
  47:     0x7f8c09401140 - rustc_query_system[704b80a7bc44cd49]::query::plumbing::try_execute_query::<rustc_query_impl[217bee59c5548bf5]::queries::fn_sig, rustc_query_impl[217bee59c5548bf5]::plumbing::QueryCtxt>
  48:     0x7f8c08c805a1 - <rustc_hir_analysis[357075c2c3fc2a7b]::collect::CollectItemTypesVisitor as rustc_hir[4aa57babd8685147]::intravisit::Visitor>::visit_impl_item
  49:     0x7f8c08c7aa41 - <rustc_middle[a96ac5d591578447]::hir::map::Map>::visit_item_likes_in_module::<rustc_hir_analysis[357075c2c3fc2a7b]::collect::CollectItemTypesVisitor>
  50:     0x7f8c08c7a84c - rustc_hir_analysis[357075c2c3fc2a7b]::collect::collect_mod_item_types
  51:     0x7f8c09ac706e - rustc_query_system[704b80a7bc44cd49]::query::plumbing::try_execute_query::<rustc_query_impl[217bee59c5548bf5]::queries::collect_mod_item_types, rustc_query_impl[217bee59c5548bf5]::plumbing::QueryCtxt>
  52:     0x7f8c09ac6bf3 - <rustc_query_impl[217bee59c5548bf5]::Queries as rustc_middle[a96ac5d591578447]::ty::query::QueryEngine>::collect_mod_item_types
  53:     0x7f8c087b0363 - <rustc_session[7e23441c2db8ce4a]::session::Session>::track_errors::<rustc_hir_analysis[357075c2c3fc2a7b]::check_crate::{closure#0}, ()>
  54:     0x7f8c087acce2 - rustc_hir_analysis[357075c2c3fc2a7b]::check_crate
  55:     0x7f8c087a2d12 - rustc_interface[6bf42eb308c32713]::passes::analysis
  56:     0x7f8c09cab71c - rustc_query_system[704b80a7bc44cd49]::query::plumbing::try_execute_query::<rustc_query_impl[217bee59c5548bf5]::queries::analysis, rustc_query_impl[217bee59c5548bf5]::plumbing::QueryCtxt>
  57:     0x7f8c09cab410 - <rustc_query_impl[217bee59c5548bf5]::Queries as rustc_middle[a96ac5d591578447]::ty::query::QueryEngine>::analysis
  58:     0x7f8c09ad02f9 - <rustc_middle[a96ac5d591578447]::ty::context::GlobalCtxt>::enter::<rustc_driver_impl[d355a67661263e47]::run_compiler::{closure#1}::{closure#2}::{closure#4}, core[125d846441ac421f]::result::Result<(), rustc_span[f8bdfaef83e46314]::ErrorGuaranteed>>
  59:     0x7f8c096c8498 - rustc_span[f8bdfaef83e46314]::with_source_map::<core[125d846441ac421f]::result::Result<(), rustc_span[f8bdfaef83e46314]::ErrorGuaranteed>, rustc_interface[6bf42eb308c32713]::interface::run_compiler<core[125d846441ac421f]::result::Result<(), rustc_span[f8bdfaef83e46314]::ErrorGuaranteed>, rustc_driver_impl[d355a67661263e47]::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
  60:     0x7f8c096bf70c - std[e52d7c968ed01318]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[6bf42eb308c32713]::util::run_in_thread_pool_with_globals<rustc_interface[6bf42eb308c32713]::interface::run_compiler<core[125d846441ac421f]::result::Result<(), rustc_span[f8bdfaef83e46314]::ErrorGuaranteed>, rustc_driver_impl[d355a67661263e47]::run_compiler::{closure#1}>::{closure#0}, core[125d846441ac421f]::result::Result<(), rustc_span[f8bdfaef83e46314]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[125d846441ac421f]::result::Result<(), rustc_span[f8bdfaef83e46314]::ErrorGuaranteed>>
  61:     0x7f8c096bf13a - <<std[e52d7c968ed01318]::thread::Builder>::spawn_unchecked_<rustc_interface[6bf42eb308c32713]::util::run_in_thread_pool_with_globals<rustc_interface[6bf42eb308c32713]::interface::run_compiler<core[125d846441ac421f]::result::Result<(), rustc_span[f8bdfaef83e46314]::ErrorGuaranteed>, rustc_driver_impl[d355a67661263e47]::run_compiler::{closure#1}>::{closure#0}, core[125d846441ac421f]::result::Result<(), rustc_span[f8bdfaef83e46314]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[125d846441ac421f]::result::Result<(), rustc_span[f8bdfaef83e46314]::ErrorGuaranteed>>::{closure#1} as core[125d846441ac421f]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  62:     0x7f8c07173793 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hc0a50816e1eb2bba
                               at /rustc/7b4f48927dce585f747a58083b45ab62b9d73a53/library/alloc/src/boxed.rs:1988:9
  63:     0x7f8c07173793 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hb2f83fc2049033c3
                               at /rustc/7b4f48927dce585f747a58083b45ab62b9d73a53/library/alloc/src/boxed.rs:1988:9
  64:     0x7f8c07173793 - std::sys::unix::thread::Thread::new::thread_start::hce5861512f8bf7ea
                               at /rustc/7b4f48927dce585f747a58083b45ab62b9d73a53/library/std/src/sys/unix/thread.rs:108:17
  65:     0x7f8c06f05bb5 - <unknown>
  66:     0x7f8c06f87d90 - <unknown>
  67:                0x0 - <unknown>

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 (7b4f48927 2023-03-12) running on x86_64-unknown-linux-gnu

query stack during panic:
#0 [crate_variances] computing the variances for items in this crate
#1 [variances_of] computing the variances of `Windows`
#2 [fn_sig] computing function signature of `<impl at 48.rs:23:1: 23:28>::T`
#3 [collect_mod_item_types] collecting item types in top-level module
#4 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to 11 previous errors; 1 warning emitted

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

@matthiaskrgr matthiaskrgr 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. C-bug Category: This is a bug. labels Mar 13, 2023
@langston-barrett
Copy link

langston-barrett commented Mar 13, 2023

Minimized with treereduce:

struct Windows<T> {}

impl<T> Windows {
    type Item = &[T];

    fn next() -> Option<Self::Item> {}
}

impl<T> Windows<T> {
    fn T() -> Option<Self::Item> {}
}

@rustbot label +S-bug-has-mcve

@rust-lang-glacier-bot rust-lang-glacier-bot added the glacier ICE tracked in rust-lang/glacier. label Mar 14, 2023
@matthiaskrgr
Copy link
Member Author

searched toolchains 7aa413d through 5243ea5


Regression in 7b55296


@bwmf2
Copy link
Contributor

bwmf2 commented Mar 17, 2023

Alternative:

#![allow(incomplete_features)]
#![feature(inherent_associated_types)]

struct Windows<T> {}

impl<T> Windows<()> {
    type Item = T;

    fn next() -> Self::Item {}
}

impl<T> Windows<T> {
    fn gates() -> Self::Item {}
}

Would the error change if the compiler is built with debug = true?

@rustbot rustbot added the S-has-mcve Status: A Minimal Complete and Verifiable Example has been found for this issue label Mar 18, 2023
@JohnTitor
Copy link
Member

Triage: This is no longer ICE since today's nightly, I assume #109410 fixed it. Marking as E-needs-test just in case regression tests there didn't cover this case.
@rustbot labels: +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 May 9, 2023
JohnTitor added a commit to JohnTitor/rust that referenced this issue Jun 25, 2023
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
bors added a commit to rust-lang-ci/rust that referenced this issue Jun 25, 2023
…iaskrgr

Rollup of 5 pull requests

Successful merges:

 - rust-lang#112976 (Add test for futures with HRTB)
 - rust-lang#113013 (rustdoc: get rid of extra line when line-wrapping fn decls with empty arg list)
 - rust-lang#113030 (Add a regression test for rust-lang#109071)
 - rust-lang#113031 (Add a regression test for rust-lang#110933)
 - rust-lang#113036 (Accept `ReStatic` for RPITIT)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors closed this as completed in dfd6d70 Jun 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. glacier ICE tracked in rust-lang/glacier. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ S-has-mcve Status: A Minimal Complete and Verifiable Example has been found for this issue 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