Skip to content

Standard library function bridge::closure::Closure::<'a, A, R>::call does not codegen #282

@avanhatt

Description

@avanhatt

Error:

thread 'rustc' panicked at 'assertion failed: fat_ptr.typ().is_rust_trait_fat_ptr(&self.symbol_table) ||\n    fat_ptr.typ().is_rust_slice_fat_ptr(&self.symbol_table)', compiler/rustc_codegen_llvm/src/gotoc/place.rs:259:21
stack backtrace:
   0: rust_begin_unwind
             at /home/ubuntu/rmc/library/std/src/panicking.rs:515:5
   1: core::panicking::panic_fmt
             at /home/ubuntu/rmc/library/core/src/panicking.rs:92:14
   2: core::panicking::panic
             at /home/ubuntu/rmc/library/core/src/panicking.rs:50:5
   3: rustc_codegen_llvm::gotoc::place::<impl rustc_codegen_llvm::gotoc::metadata::GotocCtx>::codegen_projection
             at /home/ubuntu/rmc/compiler/rustc_codegen_llvm/src/gotoc/place.rs:259:21
   4: rustc_codegen_llvm::gotoc::place::<impl rustc_codegen_llvm::gotoc::metadata::GotocCtx>::codegen_place::{{closure}}
             at /home/ubuntu/rmc/compiler/rustc_codegen_llvm/src/gotoc/place.rs:385:53
   5: core::iter::adapters::copied::copy_fold::{{closure}}
             at /home/ubuntu/rmc/library/core/src/iter/adapters/copied.rs:26:22
   6: core::iter::traits::iterator::Iterator::fold
             at /home/ubuntu/rmc/library/core/src/iter/traits/iterator.rs:2153:21
   7: <core::iter::adapters::copied::Copied<I> as core::iter::traits::iterator::Iterator>::fold
             at /home/ubuntu/rmc/library/core/src/iter/adapters/copied.rs:62:9
   8: rustc_codegen_llvm::gotoc::place::<impl rustc_codegen_llvm::gotoc::metadata::GotocCtx>::codegen_place
             at /home/ubuntu/rmc/compiler/rustc_codegen_llvm/src/gotoc/place.rs:383:9
   9: rustc_codegen_llvm::gotoc::rvalue::<impl rustc_codegen_llvm::gotoc::metadata::GotocCtx>::codegen_rvalue_ref
             at /home/ubuntu/rmc/compiler/rustc_codegen_llvm/src/gotoc/rvalue.rs:102:26
  10: rustc_codegen_llvm::gotoc::rvalue::<impl rustc_codegen_llvm::gotoc::metadata::GotocCtx>::codegen_rvalue
             at /home/ubuntu/rmc/compiler/rustc_codegen_llvm/src/gotoc/rvalue.rs:383:63
  11: rustc_codegen_llvm::gotoc::statement::<impl rustc_codegen_llvm::gotoc::metadata::GotocCtx>::codegen_statement
             at /home/ubuntu/rmc/compiler/rustc_codegen_llvm/src/gotoc/statement.rs:460:60
  12: rustc_codegen_llvm::gotoc::<impl rustc_codegen_llvm::gotoc::metadata::GotocCtx>::codegen_block
             at /home/ubuntu/rmc/compiler/rustc_codegen_llvm/src/gotoc/mod.rs:60:32
  13: rustc_codegen_llvm::gotoc::<impl rustc_codegen_llvm::gotoc::metadata::GotocCtx>::codegen_function::{{closure}}
             at /home/ubuntu/rmc/compiler/rustc_codegen_llvm/src/gotoc/mod.rs:142:71
  14: core::iter::traits::iterator::Iterator::for_each::call::{{closure}}
             at /home/ubuntu/rmc/library/core/src/iter/traits/iterator.rs:733:29
  15: core::iter::adapters::map::map_fold::{{closure}}
             at /home/ubuntu/rmc/library/core/src/iter/adapters/map.rs:82:21
  16: <core::iter::adapters::enumerate::Enumerate<I> as core::iter::traits::iterator::Iterator>::fold::enumerate::{{closure}}
             at /home/ubuntu/rmc/library/core/src/iter/adapters/enumerate.rs:104:27
  17: core::iter::traits::iterator::Iterator::fold
             at /home/ubuntu/rmc/library/core/src/iter/traits/iterator.rs:2153:21
  18: <core::iter::adapters::enumerate::Enumerate<I> as core::iter::traits::iterator::Iterator>::fold
             at /home/ubuntu/rmc/library/core/src/iter/adapters/enumerate.rs:110:9
  19: <core::iter::adapters::map::Map<I,F> as core::iter::traits::iterator::Iterator>::fold
             at /home/ubuntu/rmc/library/core/src/iter/adapters/map.rs:122:9
  20: core::iter::traits::iterator::Iterator::for_each
             at /home/ubuntu/rmc/library/core/src/iter/traits/iterator.rs:736:9
  21: rustc_codegen_llvm::gotoc::<impl rustc_codegen_llvm::gotoc::metadata::GotocCtx>::codegen_function
             at /home/ubuntu/rmc/compiler/rustc_codegen_llvm/src/gotoc/mod.rs:142:13
  22: <rustc_codegen_llvm::gotoc::GotocCodegenBackend as rustc_codegen_ssa::traits::backend::CodegenBackend>::codegen_crate
             at /home/ubuntu/rmc/compiler/rustc_codegen_llvm/src/gotoc/mod.rs:315:25
  23: rustc_interface::passes::start_codegen::{{closure}}
             at /home/ubuntu/rmc/compiler/rustc_interface/src/passes.rs:1060:9
  24: rustc_data_structures::profiling::VerboseTimingGuard::run
             at /home/ubuntu/rmc/compiler/rustc_data_structures/src/profiling.rs:573:9
  25: rustc_session::utils::<impl rustc_session::session::Session>::time
             at /home/ubuntu/rmc/compiler/rustc_session/src/utils.rs:16:9
  26: rustc_interface::passes::start_codegen
             at /home/ubuntu/rmc/compiler/rustc_interface/src/passes.rs:1059:19
  27: rustc_interface::queries::Queries::ongoing_codegen::{{closure}}::{{closure}}
             at /home/ubuntu/rmc/compiler/rustc_interface/src/queries.rs:295:20
  28: rustc_interface::passes::QueryContext::enter::{{closure}}
             at /home/ubuntu/rmc/compiler/rustc_interface/src/passes.rs:799:42
  29: rustc_middle::ty::context::tls::enter_context::{{closure}}
             at /home/ubuntu/rmc/compiler/rustc_middle/src/ty/context.rs:1744:50
  30: rustc_middle::ty::context::tls::set_tlv
             at /home/ubuntu/rmc/compiler/rustc_middle/src/ty/context.rs:1728:9
  31: rustc_middle::ty::context::tls::enter_context
             at /home/ubuntu/rmc/compiler/rustc_middle/src/ty/context.rs:1744:9
  32: rustc_interface::passes::QueryContext::enter
             at /home/ubuntu/rmc/compiler/rustc_interface/src/passes.rs:799:9
  33: rustc_interface::queries::Queries::ongoing_codegen::{{closure}}
             at /home/ubuntu/rmc/compiler/rustc_interface/src/queries.rs:286:13
  34: rustc_interface::queries::Query<T>::compute
             at /home/ubuntu/rmc/compiler/rustc_interface/src/queries.rs:40:28
  35: rustc_interface::queries::Queries::ongoing_codegen
             at /home/ubuntu/rmc/compiler/rustc_interface/src/queries.rs:284:9
  36: rustc_driver::run_compiler::{{closure}}::{{closure}}
             at /home/ubuntu/rmc/compiler/rustc_driver/src/lib.rs:414:13
  37: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter
             at /home/ubuntu/rmc/compiler/rustc_interface/src/queries.rs:435:19
  38: rustc_driver::run_compiler::{{closure}}
             at /home/ubuntu/rmc/compiler/rustc_driver/src/lib.rs:313:22
  39: rustc_interface::interface::create_compiler_and_run::{{closure}}
             at /home/ubuntu/rmc/compiler/rustc_interface/src/interface.rs:208:13
  40: rustc_span::with_source_map
             at /home/ubuntu/rmc/compiler/rustc_span/src/lib.rs:873:5
  41: rustc_interface::interface::create_compiler_and_run
             at /home/ubuntu/rmc/compiler/rustc_interface/src/interface.rs:202:5
  42: rustc_interface::interface::run_compiler::{{closure}}
             at /home/ubuntu/rmc/compiler/rustc_interface/src/interface.rs:224:12
  43: rustc_interface::util::setup_callbacks_and_run_in_thread_pool_with_globals::{{closure}}::{{closure}}
             at /home/ubuntu/rmc/compiler/rustc_interface/src/util.rs:158:13
  44: scoped_tls::ScopedKey<T>::set
             at /home/ubuntu/.cargo/registry/src/github.com-1ecc6299db9ec823/scoped-tls-1.0.0/src/lib.rs:137:9
  45: rustc_span::with_session_globals
             at /home/ubuntu/rmc/compiler/rustc_span/src/lib.rs:104:5
  46: rustc_interface::util::setup_callbacks_and_run_in_thread_pool_with_globals::{{closure}}
             at /home/ubuntu/rmc/compiler/rustc_interface/src/util.rs:156:9
  47: rustc_interface::util::scoped_thread::{{closure}}
             at /home/ubuntu/rmc/compiler/rustc_interface/src/util.rs:131:24
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

error: internal compiler error: unexpected panic

Related: #109

Metadata

Metadata

Assignees

No one assigned

    Labels

    [C] BugThis is a bug. Something isn't working.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions