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

Error when trying to compile simple Rocket project. #106257

Closed
ThomasFrans opened this issue Dec 29, 2022 · 2 comments
Closed

Error when trying to compile simple Rocket project. #106257

ThomasFrans opened this issue Dec 29, 2022 · 2 comments
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

@ThomasFrans
Copy link
Contributor

Code

#[macro_use] extern crate rocket;

#[get("/")]
fn index() -> &'static str {
    "Hello world!"
}

#[launch]
fn rocket() -> _{
    rocket::build().mount("/", routes![index])
}

Meta

rustc --version --verbose:

rustc 1.68.0-nightly (d0dc9efff 2022-12-18)
binary: rustc
commit-hash: d0dc9efff14ac0a1eeceffd1e605e37eeb8362a0
commit-date: 2022-12-18
host: x86_64-unknown-linux-gnu
release: 1.68.0-nightly
LLVM version: 15.0.6

Error output

error: internal compiler error: compiler/rustc_codegen_llvm/src/context.rs:971:13: failed to get layout for `&mut Pin<&mut server::shutdown::Graceful<rocket::http::private::Incoming<rocket::ext::CancellableListener<rocket::Shutdown, L>>, service::make::MakeServiceFn<[closure@rocket::server::<impl Rocket<Orbit>>::http_server<L>::{closure#0
}::{closure#2}]>, rocket::Shutdown, hyper::common::exec::Exec>>`: unable to determine layout for `&mut Pin<&mut server::shutdown::Graceful<rocket::http::private::Incoming<rocket::ext::CancellableListener<rocket::Shutdown, L>>, service::make::MakeServiceFn<[closure@rocket::server::<impl Rocket<Orbit>>::http_server<L>::{closure#0}::{closure
#2}]>, rocket::Shutdown, hyper::common::exec::Exec>>` because `&mut Pin<&mut server::shutdown::Graceful<rocket::http::private::Incoming<rocket::ext::CancellableListener<rocket::Shutdown, L>>, service::make::MakeServiceFn<[closure@rocket::server::<impl Rocket<Orbit>>::http_server<L>::{closure#0}::{closure#2}]>, rocket::Shutdown, hyper::com
mon::exec::Exec>>` cannot be normalized

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

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.68.0-nightly (d0dc9efff 2022-12-18) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type bin -C embed-bitcode=no -C debuginfo=2 -C incremental=[REDACTED]

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

query stack during panic:
end of query stack
error: could not compile `webshop`
Backtrace

thread 'rustc' panicked at 'Box<dyn Any>', /rustc/d0dc9efff14ac0a1eeceffd1e605e37eeb8362a0/compiler/rustc_errors/src/lib.rs:973:33
   0:     0x7fde8a565a7a - std::backtrace_rs::backtrace::libunwind::trace::h196c489280b5a090
                               at /rustc/d0dc9efff14ac0a1eeceffd1e605e37eeb8362a0/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7fde8a565a7a - std::backtrace_rs::backtrace::trace_unsynchronized::h13bf778637c29636
                               at /rustc/d0dc9efff14ac0a1eeceffd1e605e37eeb8362a0/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7fde8a565a7a - std::sys_common::backtrace::_print_fmt::h0f4861fc71bccacd
                               at /rustc/d0dc9efff14ac0a1eeceffd1e605e37eeb8362a0/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x7fde8a565a7a - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h5f011e3cd484ad42
                               at /rustc/d0dc9efff14ac0a1eeceffd1e605e37eeb8362a0/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7fde8a5c87ae - core::fmt::write::h1524a82fa967022b
                               at /rustc/d0dc9efff14ac0a1eeceffd1e605e37eeb8362a0/library/core/src/fmt/mod.rs:1208:17
   5:     0x7fde8a555e45 - std::io::Write::write_fmt::ha3d33adc534ae39a
                               at /rustc/d0dc9efff14ac0a1eeceffd1e605e37eeb8362a0/library/std/src/io/mod.rs:1682:15
   6:     0x7fde8a565845 - std::sys_common::backtrace::_print::h11f95f719c502811
                               at /rustc/d0dc9efff14ac0a1eeceffd1e605e37eeb8362a0/library/std/src/sys_common/backtrace.rs:47:5
   7:     0x7fde8a565845 - std::sys_common::backtrace::print::h71adea94b47d00ae
                               at /rustc/d0dc9efff14ac0a1eeceffd1e605e37eeb8362a0/library/std/src/sys_common/backtrace.rs:34:9
   8:     0x7fde8a56858f - std::panicking::default_hook::{{closure}}::he466417f162d07e8
                               at /rustc/d0dc9efff14ac0a1eeceffd1e605e37eeb8362a0/library/std/src/panicking.rs:267:22
   9:     0x7fde8a5682cb - std::panicking::default_hook::hff6ac2c6adb87df1
                               at /rustc/d0dc9efff14ac0a1eeceffd1e605e37eeb8362a0/library/std/src/panicking.rs:286:9
  10:     0x7fde8d84b261 - <rustc_driver[308d730545d14786]::DEFAULT_HOOK::{closure#0}::{closure#0} as core[cf0a937d1125fa47]::ops::function::FnOnce<(&core[cf0a937d1125fa47]::panic::panic_info::PanicInfo,)>>::call_once::{shim:vtable#0}
  11:     0x7fde8a568dcd - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h50ec27c76f2a595f
                               at /rustc/d0dc9efff14ac0a1eeceffd1e605e37eeb8362a0/library/alloc/src/boxed.rs:2032:9
  12:     0x7fde8a568dcd - std::panicking::rust_panic_with_hook::hcb61d2700034f188
                               at /rustc/d0dc9efff14ac0a1eeceffd1e605e37eeb8362a0/library/std/src/panicking.rs:692:13
  13:     0x7fde8d6e30a1 - std[645413f22396c11]::panicking::begin_panic::<rustc_errors[3067a2436b21c54]::ExplicitBug>::{closure#0}
  14:     0x7fde8d6e2856 - std[645413f22396c11]::sys_common::backtrace::__rust_end_short_backtrace::<std[645413f22396c11]::panicking::begin_panic<rustc_errors[3067a2436b21c54]::ExplicitBug>::{closure#0}, !>
  15:     0x7fde8d67c946 - std[645413f22396c11]::panicking::begin_panic::<rustc_errors[3067a2436b21c54]::ExplicitBug>
  16:     0x7fde8d6e2676 - std[645413f22396c11]::panic::panic_any::<rustc_errors[3067a2436b21c54]::ExplicitBug>
  17:     0x7fde8d6df9e9 - <rustc_errors[3067a2436b21c54]::HandlerInner>::span_bug::<rustc_span[7195c1839470b4e2]::span_encoding::Span, &alloc[e89cf99e2daa46aa]::string::String>
  18:     0x7fde8d6df650 - <rustc_errors[3067a2436b21c54]::Handler>::span_bug::<rustc_span[7195c1839470b4e2]::span_encoding::Span, &alloc[e89cf99e2daa46aa]::string::String>
  19:     0x7fde8d6e29f9 - rustc_middle[3f796d6b9d25fb15]::ty::context::tls::with_context_opt::<rustc_middle[3f796d6b9d25fb15]::ty::context::tls::with_opt<rustc_middle[3f796d6b9d25fb15]::util::bug::opt_span_bug_fmt<rustc_span[7195c1839470b4e2]::span_encoding::Span>::{closure#0}, ()>::{closure#0}, ()>
  20:     0x7fde8d6e2846 - rustc_middle[3f796d6b9d25fb15]::util::bug::opt_span_bug_fmt::<rustc_span[7195c1839470b4e2]::span_encoding::Span>
  21:     0x7fde8bf213e4 - rustc_middle[3f796d6b9d25fb15]::util::bug::span_bug_fmt::<rustc_span[7195c1839470b4e2]::span_encoding::Span>
  22:     0x7fde8d686412 - <rustc_codegen_llvm[a48ef6c2d8d93bca]::context::CodegenCx as rustc_middle[3f796d6b9d25fb15]::ty::layout::LayoutOfHelpers>::handle_layout_err
  23:     0x7fde8d682f51 - <rustc_codegen_llvm[a48ef6c2d8d93bca]::context::CodegenCx as rustc_middle[3f796d6b9d25fb15]::ty::layout::LayoutOf>::spanned_layout_of::{closure#0}
  24:     0x7fde8d68601a - <rustc_codegen_llvm[a48ef6c2d8d93bca]::context::CodegenCx as rustc_middle[3f796d6b9d25fb15]::ty::layout::LayoutOf>::layout_of
  25:     0x7fde8d67b456 - <rustc_codegen_ssa[833d31b763ae114d]::mir::place::PlaceRef<&rustc_codegen_llvm[a48ef6c2d8d93bca]::llvm_::ffi::Value>>::project_type::<rustc_codegen_llvm[a48ef6c2d8d93bca]::builder::Builder>
  26:     0x7fde8bf25019 - <rustc_codegen_ssa[833d31b763ae114d]::mir::FunctionCx<rustc_codegen_llvm[a48ef6c2d8d93bca]::builder::Builder>>::codegen_place
  27:     0x7fde8bf00e50 - <rustc_codegen_ssa[833d31b763ae114d]::mir::FunctionCx<rustc_codegen_llvm[a48ef6c2d8d93bca]::builder::Builder>>::codegen_block
  28:     0x7fde8beede07 - rustc_codegen_ssa[833d31b763ae114d]::mir::codegen_mir::<rustc_codegen_llvm[a48ef6c2d8d93bca]::builder::Builder>
  29:     0x7fde8cd10cf6 - rustc_codegen_llvm[a48ef6c2d8d93bca]::base::compile_codegen_unit::module_codegen
  30:     0x7fde8ceda6fc - <rustc_query_system[3cfc2c8ad6a9fb05]::dep_graph::graph::DepGraph<rustc_middle[3f796d6b9d25fb15]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[3f796d6b9d25fb15]::ty::context::TyCtxt, rustc_span[7195c1839470b4e2]::symbol::Symbol, rustc_codegen_ssa[833d31b763ae114d]::ModuleCodegen<rustc_codegen_llvm[a4
8ef6c2d8d93bca]::ModuleLlvm>>
  31:     0x7fde8ceda2d7 - <rustc_codegen_llvm[a48ef6c2d8d93bca]::LlvmCodegenBackend as rustc_codegen_ssa[833d31b763ae114d]::traits::backend::ExtraBackendMethods>::compile_codegen_unit
  32:     0x7fde8ced7d33 - rustc_codegen_ssa[833d31b763ae114d]::base::codegen_crate::<rustc_codegen_llvm[a48ef6c2d8d93bca]::LlvmCodegenBackend>
  33:     0x7fde8ced74d9 - <rustc_codegen_llvm[a48ef6c2d8d93bca]::LlvmCodegenBackend as rustc_codegen_ssa[833d31b763ae114d]::traits::backend::CodegenBackend>::codegen_crate
  34:     0x7fde8cada611 - <rustc_session[285c9883f1e66712]::session::Session>::time::<alloc[e89cf99e2daa46aa]::boxed::Box<dyn core[cf0a937d1125fa47]::any::Any>, rustc_interface[ef42ad965cd11b9c]::passes::start_codegen::{closure#0}>
  35:     0x7fde8cada139 - rustc_interface[ef42ad965cd11b9c]::passes::start_codegen
  36:     0x7fde8cad7e36 - <rustc_interface[ef42ad965cd11b9c]::passes::QueryContext>::enter::<<rustc_interface[ef42ad965cd11b9c]::queries::Queries>::ongoing_codegen::{closure#0}::{closure#0}, core[cf0a937d1125fa47]::result::Result<alloc[e89cf99e2daa46aa]::boxed::Box<dyn core[cf0a937d1125fa47]::any::Any>, rustc_errors[3067a2436b21c54]::Err
orGuaranteed>>
  37:     0x7fde8cad52e6 - <rustc_interface[ef42ad965cd11b9c]::queries::Queries>::ongoing_codegen
  38:     0x7fde8cad4807 - <rustc_interface[ef42ad965cd11b9c]::interface::Compiler>::enter::<rustc_driver[308d730545d14786]::run_compiler::{closure#1}::{closure#2}, core[cf0a937d1125fa47]::result::Result<core[cf0a937d1125fa47]::option::Option<rustc_interface[ef42ad965cd11b9c]::queries::Linker>, rustc_errors[3067a2436b21c54]::ErrorGuarante
ed>>
  39:     0x7fde8cacf7e8 - rustc_span[7195c1839470b4e2]::with_source_map::<core[cf0a937d1125fa47]::result::Result<(), rustc_errors[3067a2436b21c54]::ErrorGuaranteed>, rustc_interface[ef42ad965cd11b9c]::interface::run_compiler<core[cf0a937d1125fa47]::result::Result<(), rustc_errors[3067a2436b21c54]::ErrorGuaranteed>, rustc_driver[308d73054
5d14786]::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
  40:     0x7fde8cacf2d5 - <scoped_tls[39b0712e649d5f34]::ScopedKey<rustc_span[7195c1839470b4e2]::SessionGlobals>>::set::<rustc_interface[ef42ad965cd11b9c]::interface::run_compiler<core[cf0a937d1125fa47]::result::Result<(), rustc_errors[3067a2436b21c54]::ErrorGuaranteed>, rustc_driver[308d730545d14786]::run_compiler::{closure#1}>::{closur
e#0}, core[cf0a937d1125fa47]::result::Result<(), rustc_errors[3067a2436b21c54]::ErrorGuaranteed>>
  41:     0x7fde8cace8c2 - std[645413f22396c11]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[ef42ad965cd11b9c]::util::run_in_thread_pool_with_globals<rustc_interface[ef42ad965cd11b9c]::interface::run_compiler<core[cf0a937d1125fa47]::result::Result<(), rustc_errors[3067a2436b21c54]::ErrorGuaranteed>, rustc_driver[
308d730545d14786]::run_compiler::{closure#1}>::{closure#0}, core[cf0a937d1125fa47]::result::Result<(), rustc_errors[3067a2436b21c54]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[cf0a937d1125fa47]::result::Result<(), rustc_errors[3067a2436b21c54]::ErrorGuaranteed>>
  42:     0x7fde8d10827a - <<std[645413f22396c11]::thread::Builder>::spawn_unchecked_<rustc_interface[ef42ad965cd11b9c]::util::run_in_thread_pool_with_globals<rustc_interface[ef42ad965cd11b9c]::interface::run_compiler<core[cf0a937d1125fa47]::result::Result<(), rustc_errors[3067a2436b21c54]::ErrorGuaranteed>, rustc_driver[308d730545d14786]
::run_compiler::{closure#1}>::{closure#0}, core[cf0a937d1125fa47]::result::Result<(), rustc_errors[3067a2436b21c54]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[cf0a937d1125fa47]::result::Result<(), rustc_errors[3067a2436b21c54]::ErrorGuaranteed>>::{closure#1} as core[cf0a937d1125fa47]::ops::function::FnOnce<()>>::call_once::{shim:v
table#0}
  43:     0x7fde8a572dc3 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hfa728446fdf5ae93
                               at /rustc/d0dc9efff14ac0a1eeceffd1e605e37eeb8362a0/library/alloc/src/boxed.rs:2000:9
  44:     0x7fde8a572dc3 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h3934f485a9254b50
                               at /rustc/d0dc9efff14ac0a1eeceffd1e605e37eeb8362a0/library/alloc/src/boxed.rs:2000:9
  45:     0x7fde8a572dc3 - std::sys::unix::thread::Thread::new::thread_start::he535d9cd9ed14925
                               at /rustc/d0dc9efff14ac0a1eeceffd1e605e37eeb8362a0/library/std/src/sys/unix/thread.rs:108:17
  46:     0x7fde8a3058fd - <unknown>
  47:     0x7fde8a387a60 - <unknown>
  48:                0x0 - <unknown>

@ThomasFrans ThomasFrans 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 Dec 29, 2022
@Noratrieb
Copy link
Member

This is a duplicate of #105809, which has been fixed. If you update to the latest nightly it should work again.

@ThomasFrans
Copy link
Contributor Author

Ok, I should have searched for duplicates first but I didn't know what the error was. Hard to search that way 🙂

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

No branches or pull requests

2 participants