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

Standard library function bridge::client::Ident::new and similar do not codegen #281

Closed
avanhatt opened this issue Jul 1, 2021 · 0 comments · Fixed by #948
Closed

Standard library function bridge::client::Ident::new and similar do not codegen #281

avanhatt opened this issue Jul 1, 2021 · 0 comments · Fixed by #948
Labels
[C] Bug This is a bug. Something isn't working.

Comments

@avanhatt
Copy link
Contributor

avanhatt commented Jul 1, 2021

The client component of the bridge module gives us several compilation errors, skipping function that start with bridge::client:: for now.

Example error for closure within the function bridge::client::Ident::new::{closure#0}:

[compiler/rustc_codegen_llvm/src/gotoc/mod.rs:314] c.readable_instance_name(instance) = "bridge::client::Ident::new::{closure#0}"
thread 'rustc' panicked at 'Can't cast

Expr { value: Dereference(Expr { value: Member { lhs: Expr { value: Symbol { identifier: "_ZN10proc_macro6bridge6client5Ident3new28_$u7b$$u7b$closure$u7d$$u7d$17hba836d8c2ba5a327E::1::var_1" }, typ: StructTag("tag-[closure@/home/ubuntu/rmc/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/src/rust/library/proc_macro/src/bridge/client.rs:237:30: 251:18]"), location: None }, field: "0" }, typ: Pointer { typ: StructTag("tag-str") }, location: None }), typ: StructTag("tag-str"), location: None }

CInteger(Bool)', compiler/rustc_codegen_llvm/src/gotoc/cbmc/goto_program/expr.rs:408:9
stack backtrace:
   0: rust_begin_unwind
             at /home/ubuntu/rmc/library/std/src/panicking.rs:515:5
   1: std::panicking::begin_panic_fmt
             at /home/ubuntu/rmc/library/std/src/panicking.rs:457:5
   2: rustc_codegen_llvm::gotoc::cbmc::goto_program::expr::Expr::cast_to
             at /home/ubuntu/rmc/compiler/rustc_codegen_llvm/src/gotoc/cbmc/goto_program/expr.rs:408:9
   3: 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:458:33
   4: 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:56:29
   5: 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
   6: core::iter::traits::iterator::Iterator::for_each::call::{{closure}}
             at /home/ubuntu/rmc/library/core/src/iter/traits/iterator.rs:733:29
   7: core::iter::adapters::map::map_fold::{{closure}}
             at /home/ubuntu/rmc/library/core/src/iter/adapters/map.rs:82:21
   8: <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
   9: core::iter::traits::iterator::Iterator::fold
             at /home/ubuntu/rmc/library/core/src/iter/traits/iterator.rs:2153:21
  10: <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
  11: <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
  12: core::iter::traits::iterator::Iterator::for_each
             at /home/ubuntu/rmc/library/core/src/iter/traits/iterator.rs:736:9
  13: 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
  14: <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
  15: rustc_interface::passes::start_codegen::{{closure}}
             at /home/ubuntu/rmc/compiler/rustc_interface/src/passes.rs:1060:9
  16: rustc_data_structures::profiling::VerboseTimingGuard::run
             at /home/ubuntu/rmc/compiler/rustc_data_structures/src/profiling.rs:573:9
  17: rustc_session::utils::<impl rustc_session::session::Session>::time
             at /home/ubuntu/rmc/compiler/rustc_session/src/utils.rs:16:9
  18: rustc_interface::passes::start_codegen
             at /home/ubuntu/rmc/compiler/rustc_interface/src/passes.rs:1059:19
  19: rustc_interface::queries::Queries::ongoing_codegen::{{closure}}::{{closure}}
             at /home/ubuntu/rmc/compiler/rustc_interface/src/queries.rs:295:20
  20: rustc_interface::passes::QueryContext::enter::{{closure}}
             at /home/ubuntu/rmc/compiler/rustc_interface/src/passes.rs:799:42
  21: rustc_middle::ty::context::tls::enter_context::{{closure}}
             at /home/ubuntu/rmc/compiler/rustc_middle/src/ty/context.rs:1744:50
  22: rustc_middle::ty::context::tls::set_tlv
             at /home/ubuntu/rmc/compiler/rustc_middle/src/ty/context.rs:1728:9
  23: rustc_middle::ty::context::tls::enter_context
             at /home/ubuntu/rmc/compiler/rustc_middle/src/ty/context.rs:1744:9
  24: rustc_interface::passes::QueryContext::enter
             at /home/ubuntu/rmc/compiler/rustc_interface/src/passes.rs:799:9
  25: rustc_interface::queries::Queries::ongoing_codegen::{{closure}}
             at /home/ubuntu/rmc/compiler/rustc_interface/src/queries.rs:286:13
  26: rustc_interface::queries::Query<T>::compute
             at /home/ubuntu/rmc/compiler/rustc_interface/src/queries.rs:40:28
  27: rustc_interface::queries::Queries::ongoing_codegen
             at /home/ubuntu/rmc/compiler/rustc_interface/src/queries.rs:284:9
  28: rustc_driver::run_compiler::{{closure}}::{{closure}}
             at /home/ubuntu/rmc/compiler/rustc_driver/src/lib.rs:414:13
  29: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter
             at /home/ubuntu/rmc/compiler/rustc_interface/src/queries.rs:435:19
  30: rustc_driver::run_compiler::{{closure}}
             at /home/ubuntu/rmc/compiler/rustc_driver/src/lib.rs:313:22
  31: rustc_interface::interface::create_compiler_and_run::{{closure}}
             at /home/ubuntu/rmc/compiler/rustc_interface/src/interface.rs:208:13
  32: rustc_span::with_source_map
             at /home/ubuntu/rmc/compiler/rustc_span/src/lib.rs:873:5
  33: rustc_interface::interface::create_compiler_and_run
             at /home/ubuntu/rmc/compiler/rustc_interface/src/interface.rs:202:5
  34: rustc_interface::interface::run_compiler::{{closure}}
             at /home/ubuntu/rmc/compiler/rustc_interface/src/interface.rs:224:12
  35: 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
  36: scoped_tls::ScopedKey<T>::set
             at /home/ubuntu/.cargo/registry/src/github.com-1ecc6299db9ec823/scoped-tls-1.0.0/src/lib.rs:137:9
  37: rustc_span::with_session_globals
             at /home/ubuntu/rmc/compiler/rustc_span/src/lib.rs:104:5
  38: 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
  39: 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

@avanhatt avanhatt added the [C] Bug This is a bug. Something isn't working. label Jul 1, 2021
@avanhatt avanhatt mentioned this issue Aug 25, 2021
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[C] Bug This is a bug. Something isn't working.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant