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]: error performing operation: fully_perform #132691

Closed
1 of 4 tasks
wxie7 opened this issue Nov 6, 2024 · 3 comments
Closed
1 of 4 tasks

[ICE]: error performing operation: fully_perform #132691

wxie7 opened this issue Nov 6, 2024 · 3 comments
Labels
A-associated-items Area: Associated items (types, constants & functions) A-trait-objects Area: trait objects, vtable layout 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. T-types Relevant to the types team, which will review and decide on the PR/issue.

Comments

@wxie7
Copy link

wxie7 commented Nov 6, 2024

Code

trait Database: Restriction<Inner = u32> {}
trait Restriction {
    type Inner;
}
struct Test {}
impl Database for Test {}
impl Restriction for Test {
    type Inner = u32;
}
fn main() {
    let t = Test {};
    let x: &dyn Database<Inner = _> = &t;
}

Affected release channels

  • Previous Stable
  • Current Stable
  • Current Beta
  • Current Nightly

Rust Version

rustc 1.84.0-nightly (bc5cf99 2024-11-05)
binary: rustc
commit-hash: bc5cf99
commit-date: 2024-11-05
host: x86_64-unknown-linux-gnu
release: 1.84.0-nightly
LLVM version: 19.1.3

Current error output

No response

Backtrace

     0: <rustc_errors::DiagCtxtInner>::emit_diagnostic
     1: <rustc_errors::DiagCtxtHandle>::emit_diagnostic
     2: <rustc_span::ErrorGuaranteed as rustc_errors::diagnostic::EmissionGuarantee>::emit_producing_guarantee
     3: <rustc_errors::DiagCtxtHandle>::span_delayed_bug::<rustc_span::span_encoding::Span, alloc::string::String>
     4: <rustc_borrowck::type_check::TypeChecker>::ascribe_user_type
     5: rustc_borrowck::type_check::type_check
     6: rustc_borrowck::nll::compute_regions
     7: rustc_borrowck::do_mir_borrowck
     8: rustc_query_impl::plumbing::__rust_begin_short_backtrace::<rustc_query_impl::query_impl::mir_borrowck::dynamic_query::{closure#2}::{closure#0}, rustc_middle::query::erase::Erased<[u8; 8]>>
     9: rustc_query_system::query::plumbing::try_execute_query::<rustc_query_impl::DynamicConfig<rustc_query_system::query::caches::VecCache<rustc_span::def_id::LocalDefId, rustc_middle::query::erase::Erased<[u8; 8]>>, false, false, false>, rustc_query_impl::plumbing::QueryCtxt, false>
    10: rustc_query_impl::query_impl::mir_borrowck::get_query_non_incr::__rust_end_short_backtrace
    11: rustc_interface::passes::run_required_analyses
    12: rustc_interface::passes::analysis
    13: 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]>>
    14: 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>
    15: rustc_query_impl::query_impl::analysis::get_query_non_incr::__rust_end_short_backtrace
    16: rustc_interface::interface::run_compiler::<core::result::Result<(), rustc_span::ErrorGuaranteed>, rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}
    17: std::sys::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#1}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>::{closure#0}::{closure#0}, core::result::Result<(), rustc_span::ErrorGuaranteed>>
    18: <<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#1}, 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}
    19: std::sys::pal::unix::thread::Thread::new::thread_start
    20: start_thread
               at ./nptl/pthread_create.c:442:8
    21: __GI___clone3
               at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:81

Anything else?

note: compiler flags: --crate-type staticlib -C link-dead-code -C debuginfo=2 -C opt-level=3 -Z mir-opt-level=3 (fmease: unnecessary)

@wxie7 wxie7 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 Nov 6, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Nov 6, 2024
@fmease fmease added A-associated-items Area: Associated items (types, constants & functions) A-trait-objects Area: trait objects, vtable layout labels Nov 6, 2024
@fmease
Copy link
Member

fmease commented Nov 6, 2024

Not sure if useful: -Znext-solver -Zverbose-internals currently ices with (indentation added by me):

thread 'rustc' panicked at /rustc/fbab78289dd8c6e8860034e0048cfb538f217700/compiler/rustc_next_trait_solver/src/solve/eval_ctxt/canonical.rs:392:86:
called `Result::unwrap()` on an `Err` value: ExistentialMismatch(
    ExpectedFound {
        expected: [
            Binder { value: Trait(Database), bound_vars: [] },
            Binder { value: Projection(Inner = u32), bound_vars: [] },
            Binder { value: Projection(Inner = u32), bound_vars: [] }
        ],
        found: [
            Binder { value: Trait(Database), bound_vars: [] },
            Binder { value: Projection(Inner = ?2t), bound_vars: [] },
            Binder { value: Projection(Inner = u32), bound_vars: [] }
        ]
    }
)

@fmease fmease added T-types Relevant to the types team, which will review and decide on the PR/issue. and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Nov 6, 2024
@matthiaskrgr
Copy link
Member

the code is from #79590 , closing as duplicate

@fmease fmease closed this as not planned Won't fix, can't repro, duplicate, stale Nov 6, 2024
@modesto15
Copy link

#132691

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-associated-items Area: Associated items (types, constants & functions) A-trait-objects Area: trait objects, vtable layout 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. T-types Relevant to the types team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

5 participants