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: self.err_count() changed but an error was not emitted #119652

Closed
matthiaskrgr opened this issue Jan 6, 2024 · 4 comments · Fixed by #119752
Closed

ice: self.err_count() changed but an error was not emitted #119652

matthiaskrgr opened this issue Jan 6, 2024 · 4 comments · Fixed by #119752
Assignees
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@matthiaskrgr
Copy link
Member

auto-reduced (treereduce-rust):

trait B {
    fn f(a: B) -> B;
}

fn main() {}

original:

#![allow(bare_trait_objects)]
trait A: Sized {
    fn f(a: A) -> A;
    //~^ ERROR associated item referring to unboxed trait object for its own trait
    //~| ERROR the trait `A` cannot be made into an object
}
trait B {
    fn f(a: B) -> B;
    //~^ ERROR associated item referring to unboxed trait object for its own trait
    //~| ERROR the trait `B` cannot be made into an object
}
trait C {
    fn f(&self, a: C) -> C;
}

fn main() {}

Version information

rustc 1.77.0-nightly (aa7e9f21e 2024-01-06)
binary: rustc
commit-hash: aa7e9f21e9a058a4822b6cdc19ee88c80cdb3750
commit-date: 2024-01-06
host: x86_64-unknown-linux-gnu
release: 1.77.0-nightly
LLVM version: 17.0.6

Command:
/home/matthias/.rustup/toolchains/master/bin/rustc --edition=2021

Program output

error: internal compiler error: no errors encountered even though `span_delayed_bug` issued

error: internal compiler error[E0391]: cycle detected when computing function signature of `B::f`
 --> /tmp/icemaker_global_tempdir.OyUfQ7KVML5V/rustc_testrunner_tmpdir_reporting.vRfyT7raOx62/mvce.rs:2:5
  |
2 |     fn f(a: B) -> B;
  |     ^^^^^^^^^^^^^^^^
  |
note: ...which requires checking if trait `B` is object safe...
 --> /tmp/icemaker_global_tempdir.OyUfQ7KVML5V/rustc_testrunner_tmpdir_reporting.vRfyT7raOx62/mvce.rs:1:1
  |
1 | trait B {
  | ^^^^^^^
note: ...which requires determining object safety of trait `B`...
 --> /tmp/icemaker_global_tempdir.OyUfQ7KVML5V/rustc_testrunner_tmpdir_reporting.vRfyT7raOx62/mvce.rs:1:1
  |
1 | trait B {
  | ^^^^^^^
  = note: ...which again requires computing function signature of `B::f`, completing the cycle
note: cycle used when collecting item types in top-level module
 --> /tmp/icemaker_global_tempdir.OyUfQ7KVML5V/rustc_testrunner_tmpdir_reporting.vRfyT7raOx62/mvce.rs:1:1
  |
1 | / trait B {
2 | |     fn f(a: B) -> B;
3 | | }
4 | |
5 | | fn main() {}
  | |____________^
  = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
note: delayed at compiler/rustc_query_system/src/query/job.rs:605:16
         0: <rustc_errors::DiagCtxtInner>::emit_diagnostic_without_consuming
         1: <rustc_errors::DiagCtxt>::emit_diagnostic_without_consuming
         2: <rustc_span::ErrorGuaranteed as rustc_errors::diagnostic_builder::EmissionGuarantee>::emit_producing_guarantee
         3: rustc_query_system::query::plumbing::mk_cycle::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::SingleCache<rustc_middle::query::erase::Erased<[u8; 24]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt>
         4: rustc_query_system::query::plumbing::cycle_error::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::SingleCache<rustc_middle::query::erase::Erased<[u8; 24]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt>
         5: rustc_query_impl::query_impl::fn_sig::get_query_non_incr::__rust_end_short_backtrace
         6: rustc_middle::query::plumbing::query_get_at::<rustc_query_system::query::caches::DefaultCache<rustc_span::def_id::DefId, rustc_middle::query::erase::Erased<[u8; 24]>>>
         7: rustc_trait_selection::traits::object_safety::virtual_call_violations_for_method
         8: rustc_trait_selection::traits::object_safety::object_safety_violations_for_assoc_item
         9: <core::iter::adapters::flatten::FlatMap<core::iter::adapters::map::Map<core::iter::adapters::map::Map<core::slice::iter::Iter<(rustc_span::symbol::Symbol, rustc_middle::ty::assoc::AssocItem)>, <rustc_data_structures::sorted_map::index_map::SortedIndexMultiMap<u32, rustc_span::symbol::Symbol, rustc_middle::ty::assoc::AssocItem>>::iter::{closure#0}>, <rustc_middle::ty::assoc::AssocItems>::in_definition_order::{closure#0}>, alloc::vec::Vec<rustc_middle::traits::ObjectSafetyViolation>, rustc_trait_selection::traits::object_safety::object_safety_violations_for_trait::{closure#0}> as core::iter::traits::iterator::Iterator>::next
        10: <core::iter::adapters::flatten::FlatMap<rustc_trait_selection::traits::util::SupertraitDefIds, alloc::vec::Vec<rustc_middle::traits::ObjectSafetyViolation>, rustc_trait_selection::traits::object_safety::object_safety_violations::{closure#0}> as core::iter::traits::iterator::Iterator>::next
        11: rustc_trait_selection::traits::object_safety::object_safety_violations
        12: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::object_safety_violations::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 16]>>
        13: <rustc_query_impl::query_impl::object_safety_violations::dynamic_query::{closure#2} as core::ops::function::FnOnce<(rustc_middle::ty::context::TyCtxt, rustc_span::def_id::DefId)>>::call_once
        14: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::DefaultCache<rustc_span::def_id::DefId, rustc_middle::query::erase::Erased<[u8; 16]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
        15: rustc_query_impl::query_impl::object_safety_violations::get_query_non_incr::__rust_end_short_backtrace
        16: rustc_middle::query::plumbing::query_get_at::<rustc_query_system::query::caches::DefaultCache<rustc_span::def_id::DefId, rustc_middle::query::erase::Erased<[u8; 16]>>>
        17: rustc_trait_selection::traits::object_safety::check_is_object_safe
        18: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::check_is_object_safe::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 1]>>
        19: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::DefaultCache<rustc_span::def_id::DefId, rustc_middle::query::erase::Erased<[u8; 1]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
        20: rustc_query_impl::query_impl::check_is_object_safe::get_query_non_incr::__rust_end_short_backtrace
        21: rustc_middle::query::plumbing::query_get_at::<rustc_query_system::query::caches::DefaultCache<rustc_span::def_id::DefId, rustc_middle::query::erase::Erased<[u8; 1]>>>
        22: <dyn rustc_hir_analysis::astconv::AstConv>::maybe_lint_impl_trait
        23: <dyn rustc_hir_analysis::astconv::AstConv>::ast_ty_to_ty_inner
        24: <dyn rustc_hir_analysis::astconv::AstConv>::ty_of_fn
        25: rustc_hir_analysis::collect::fn_sig
        26: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::fn_sig::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 24]>>
        27: <rustc_query_impl::query_impl::fn_sig::dynamic_query::{closure#2} as core::ops::function::FnOnce<(rustc_middle::ty::context::TyCtxt, rustc_span::def_id::DefId)>>::call_once
        28: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::DefaultCache<rustc_span::def_id::DefId, rustc_middle::query::erase::Erased<[u8; 24]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
        29: rustc_query_impl::query_impl::fn_sig::get_query_non_incr::__rust_end_short_backtrace
        30: <rustc_hir_analysis::collect::CollectItemTypesVisitor as rustc_hir::intravisit::Visitor>::visit_trait_item
        31: rustc_hir_analysis::collect::collect_mod_item_types
        32: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::collect_mod_item_types::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 0]>>
        33: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::DefaultCache<rustc_span::def_id::LocalModDefId, rustc_middle::query::erase::Erased<[u8; 0]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
        34: rustc_query_impl::query_impl::collect_mod_item_types::get_query_non_incr::__rust_end_short_backtrace
        35: rustc_hir_analysis::check_crate
        36: rustc_interface::passes::analysis
        37: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 1]>>
        38: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::SingleCache<rustc_middle::query::erase::Erased<[u8; 1]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
        39: rustc_query_impl::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
        40: rustc_interface::interface::run_compiler::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#0}
        41: std::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface::util::run_in_thread_with_globals<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#0}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
        42: <<std::thread::Builder>::spawn_unchecked_<rustc_interface::util::run_in_thread_with_globals<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#0}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{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}
        43: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                   at /rustc/aa7e9f21e9a058a4822b6cdc19ee88c80cdb3750/library/alloc/src/boxed.rs:2016:9
        44: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                   at /rustc/aa7e9f21e9a058a4822b6cdc19ee88c80cdb3750/library/alloc/src/boxed.rs:2016:9
        45: std::sys::unix::thread::Thread::new::thread_start
                   at /rustc/aa7e9f21e9a058a4822b6cdc19ee88c80cdb3750/library/std/src/sys/unix/thread.rs:108:17
        46: <unknown>
        47: <unknown>
 --> /tmp/icemaker_global_tempdir.OyUfQ7KVML5V/rustc_testrunner_tmpdir_reporting.vRfyT7raOx62/mvce.rs:2:5
  |
2 |     fn f(a: B) -> B;
  |     ^^^^^^^^^^^^^^^^

error: internal compiler error: `self.err_count()` changed but an error was not emitted
  |
  = note: delayed at /rustc/aa7e9f21e9a058a4822b6cdc19ee88c80cdb3750/compiler/rustc_session/src/session.rs:346:28
             0: <rustc_errors::DiagCtxtInner>::emit_diagnostic_without_consuming
             1: <rustc_errors::DiagCtxt>::emit_diagnostic_without_consuming
             2: <rustc_errors::DiagCtxt>::emit_diagnostic
             3: <rustc_errors::DiagCtxt>::span_delayed_bug::<rustc_span::span_encoding::Span, &str>
             4: rustc_hir_analysis::check_crate
             5: rustc_interface::passes::analysis
             6: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 1]>>
             7: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::SingleCache<rustc_middle::query::erase::Erased<[u8; 1]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
             8: rustc_query_impl::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
             9: rustc_interface::interface::run_compiler::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#0}
            10: std::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface::util::run_in_thread_with_globals<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#0}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
            11: <<std::thread::Builder>::spawn_unchecked_<rustc_interface::util::run_in_thread_with_globals<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#0}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{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}
            12: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                       at /rustc/aa7e9f21e9a058a4822b6cdc19ee88c80cdb3750/library/alloc/src/boxed.rs:2016:9
            13: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                       at /rustc/aa7e9f21e9a058a4822b6cdc19ee88c80cdb3750/library/alloc/src/boxed.rs:2016:9
            14: std::sys::unix::thread::Thread::new::thread_start
                       at /rustc/aa7e9f21e9a058a4822b6cdc19ee88c80cdb3750/library/std/src/sys/unix/thread.rs:108:17
            15: <unknown>
            16: <unknown>
          

error: internal compiler error[E0782]: trait objects must include the `dyn` keyword
 --> /tmp/icemaker_global_tempdir.OyUfQ7KVML5V/rustc_testrunner_tmpdir_reporting.vRfyT7raOx62/mvce.rs:2:13
  |
2 |     fn f(a: B) -> B;
  |             ^
  |
  = note: `B` it is not object safe, so it can't be `dyn`
note: delayed at compiler/rustc_hir_analysis/src/astconv/lint.rs:216:21
         0: <rustc_errors::DiagCtxtInner>::emit_diagnostic_without_consuming
         1: <rustc_errors::DiagCtxtInner>::emit_diagnostic
         2: <rustc_errors::DiagCtxtInner>::emit_stashed_diagnostics
         3: <rustc_errors::DiagCtxt>::print_error_count
         4: <rustc_session::session::Session>::finish_diagnostics
         5: rustc_interface::interface::run_compiler::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#0}
         6: std::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface::util::run_in_thread_with_globals<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#0}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
         7: <<std::thread::Builder>::spawn_unchecked_<rustc_interface::util::run_in_thread_with_globals<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#0}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{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}
         8: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                   at /rustc/aa7e9f21e9a058a4822b6cdc19ee88c80cdb3750/library/alloc/src/boxed.rs:2016:9
         9: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                   at /rustc/aa7e9f21e9a058a4822b6cdc19ee88c80cdb3750/library/alloc/src/boxed.rs:2016:9
        10: std::sys::unix::thread::Thread::new::thread_start
                   at /rustc/aa7e9f21e9a058a4822b6cdc19ee88c80cdb3750/library/std/src/sys/unix/thread.rs:108:17
        11: <unknown>
        12: <unknown>
 --> /tmp/icemaker_global_tempdir.OyUfQ7KVML5V/rustc_testrunner_tmpdir_reporting.vRfyT7raOx62/mvce.rs:2:13
  |
2 |     fn f(a: B) -> B;
  |             ^
help: use a new generic type parameter, constrained by `B`
  |
2 |     fn f<T: B>(a: T) -> B;
  |         ++++++    ~
help: you can also use an opaque type, but users won't be able to specify the type parameter when calling the `fn`, having to rely exclusively on type inference
  |
2 |     fn f(a: impl B) -> B;
  |             ++++

error: internal compiler error[E0782]: trait objects must include the `dyn` keyword
 --> /tmp/icemaker_global_tempdir.OyUfQ7KVML5V/rustc_testrunner_tmpdir_reporting.vRfyT7raOx62/mvce.rs:2:19
  |
2 |     fn f(a: B) -> B;
  |                   ^
  |
note: delayed at compiler/rustc_hir_analysis/src/astconv/lint.rs:216:21
         0: <rustc_errors::DiagCtxtInner>::emit_diagnostic_without_consuming
         1: <rustc_errors::DiagCtxtInner>::emit_diagnostic
         2: <rustc_errors::DiagCtxtInner>::emit_stashed_diagnostics
         3: <rustc_errors::DiagCtxt>::print_error_count
         4: <rustc_session::session::Session>::finish_diagnostics
         5: rustc_interface::interface::run_compiler::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#0}
         6: std::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface::util::run_in_thread_with_globals<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#0}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
         7: <<std::thread::Builder>::spawn_unchecked_<rustc_interface::util::run_in_thread_with_globals<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#0}>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{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}
         8: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                   at /rustc/aa7e9f21e9a058a4822b6cdc19ee88c80cdb3750/library/alloc/src/boxed.rs:2016:9
         9: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
                   at /rustc/aa7e9f21e9a058a4822b6cdc19ee88c80cdb3750/library/alloc/src/boxed.rs:2016:9
        10: std::sys::unix::thread::Thread::new::thread_start
                   at /rustc/aa7e9f21e9a058a4822b6cdc19ee88c80cdb3750/library/std/src/sys/unix/thread.rs:108:17
        11: <unknown>
        12: <unknown>
 --> /tmp/icemaker_global_tempdir.OyUfQ7KVML5V/rustc_testrunner_tmpdir_reporting.vRfyT7raOx62/mvce.rs:2:19
  |
2 |     fn f(a: B) -> B;
  |                   ^
help: `B` is not object safe, use `impl B` to return an opaque type, as long as you return a single underlying type
  |
2 |     fn f(a: B) -> impl B;
  |                   ++++

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.77.0-nightly (aa7e9f21e 2024-01-06) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z dump-mir-dir=dir

query stack during panic:
end of query stack

@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 Jan 6, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Jan 6, 2024
@fmease fmease removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Jan 6, 2024
@fmease
Copy link
Member

fmease commented Jan 6, 2024

Looking at the backtrace, this also has to have regressed in #119148, cc @estebank.

@fmease
Copy link
Member

fmease commented Jan 6, 2024

(I even predicted that querying the object safety from this part of the code might cause a cycle error 🙈🙈🙈)

@estebank estebank self-assigned this Jan 9, 2024
estebank added a commit to estebank/rust that referenced this issue Jan 9, 2024
@estebank
Copy link
Contributor

estebank commented Jan 9, 2024

@fmease that wasn't quite the problem, it was because we'd correctly realize that the trait wasn't object safe, but the dyn complaint still needs to happen in 2021 for traits using themselves. Have a PR out with a fix.

@fmease
Copy link
Member

fmease commented Jan 18, 2024

Actually this doesn't ICE for me anymore on the playground (nightly, Rust 2021). Is that true? Don't have access to my machine rn, I'm on mobile ^^'.

estebank added a commit to estebank/rust that referenced this issue Jan 19, 2024
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Jan 20, 2024
Avoid ICEs in trait names without `dyn`

Check diagnostic is error before downgrading. Fix rust-lang#119633.

 Account for traits using self-trait by name without `dyn`. Fix rust-lang#119652.
@bors bors closed this as completed in 6b7e6ea Jan 20, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Jan 20, 2024
Rollup merge of rust-lang#119752 - estebank:ice-ice, r=fmease

Avoid ICEs in trait names without `dyn`

Check diagnostic is error before downgrading. Fix rust-lang#119633.

 Account for traits using self-trait by name without `dyn`. Fix rust-lang#119652.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants