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 #57409

Closed
hellow554 opened this issue Jan 7, 2019 · 3 comments
Closed

ICE #57409

hellow554 opened this issue Jan 7, 2019 · 3 comments

Comments

@hellow554
Copy link
Contributor

Discovered by cheblin: https://users.rust-lang.org/t/23968

#![feature(unboxed_closures)]
#![feature(const_vec_new)]
#![feature(fn_traits)]

pub struct PackBytes;
static mut HANDLERS: Vec<Box<dyn for<'a> FnMut<&'a mut PackBytes, Output=()>>> = Vec::new();

fn main() {
    let mut pack = PackBytes;
    unsafe { HANDLERS[0].as_mut().call_mut(&mut pack); }
}

(Playground)

Errors:

   Compiling playground v0.0.1 (/playground)
error: internal compiler error: src/librustc_codegen_llvm/abi.rs:433: argument to function with "rust-call" ABI is not a tuple

thread 'rustc' panicked at 'Box<Any>', src/librustc_errors/lib.rs:590:9
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
             at src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:39
   1: std::sys_common::backtrace::_print
             at src/libstd/sys_common/backtrace.rs:70
   2: std::panicking::default_hook::{{closure}}
             at src/libstd/sys_common/backtrace.rs:58
             at src/libstd/panicking.rs:200
   3: std::panicking::default_hook
             at src/libstd/panicking.rs:215
   4: rustc::util::common::panic_hook
   5: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:482
   6: std::panicking::begin_panic
   7: rustc_errors::Handler::bug
   8: rustc::util::bug::opt_span_bug_fmt::{{closure}}
   9: rustc::ty::context::tls::with_opt::{{closure}}
  10: rustc::ty::context::tls::with_context_opt
  11: rustc::ty::context::tls::with_opt
  12: rustc::util::bug::opt_span_bug_fmt
  13: rustc::util::bug::bug_fmt
  14: <rustc_target::abi::call::FnType<'tcx, &'tcx rustc::ty::TyS<'tcx>> as rustc_codegen_llvm::abi::FnTypeExt<'tcx>>::new_vtable
  15: rustc_codegen_ssa::mir::block::<impl rustc_codegen_ssa::mir::FunctionCx<'a, 'tcx, Bx>>::codegen_terminator
  16: rustc_codegen_ssa::mir::codegen_mir
  17: rustc_codegen_ssa::base::codegen_instance
  18: rustc_codegen_ssa::mono_item::MonoItemExt::define
  19: rustc_codegen_llvm::base::compile_codegen_unit::module_codegen
  20: rustc::dep_graph::graph::DepGraph::with_task
  21: <rustc_codegen_llvm::LlvmCodegenBackend as rustc_codegen_ssa::traits::backend::ExtraBackendMethods>::compile_codegen_unit
  22: rustc_codegen_ssa::base::codegen_crate
  23: <rustc_codegen_llvm::LlvmCodegenBackend as rustc_codegen_utils::codegen_backend::CodegenBackend>::codegen_crate
  24: rustc_driver::driver::phase_4_codegen
  25: rustc_driver::driver::compile_input::{{closure}}
  26: <std::thread::local::LocalKey<T>>::with
  27: rustc::ty::context::TyCtxt::create_and_enter
  28: rustc_driver::driver::compile_input
  29: rustc_driver::run_compiler_with_pool
  30: <scoped_tls::ScopedKey<T>>::set
  31: rustc_driver::run_compiler
  32: <scoped_tls::ScopedKey<T>>::set
  33: syntax::with_globals
  34: __rust_maybe_catch_panic
             at src/libpanic_unwind/lib.rs:92
  35: <F as alloc::boxed::FnBox<A>>::call_box
  36: std::sys::unix::thread::Thread::new::thread_start
             at /rustc/b92552d5578e4544006da0dd5e793a19c2149321/src/liballoc/boxed.rs:744
             at src/libstd/sys_common/thread.rs:14
             at src/libstd/sys/unix/thread.rs:81
  37: start_thread
  38: __clone
query stack during panic:
end of query stack
error: aborting due to previous error


note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.33.0-nightly (b92552d55 2019-01-06) running on x86_64-unknown-linux-gnu

note: compiler flags: -C codegen-units=1 -C debuginfo=2 --crate-type bin

note: some of the compiler flags provided by cargo are hidden

error: Could not compile `playground`.

To learn more, run the command again with --verbose.

@hellow554
Copy link
Contributor Author

Reduced example

#![feature(unboxed_closures)]
#![feature(fn_traits)]

fn main() {
    let handlers: Option<Box<dyn for<'a> FnMut<&'a mut (), Output=()>>> = None;
    handlers.unwrap().as_mut().call_mut(&mut ());
}

@awaitlink
Copy link
Contributor

Hmm, it seems like @cheblin has already filed this issue in #57404...

@hellow554
Copy link
Contributor Author

Sorry :/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants