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

Internal Compiler Error when compiling rocket = "0.5.0-rc.1" #93831

Closed
jonaylor89 opened this issue Feb 9, 2022 · 6 comments · Fixed by #93893
Closed

Internal Compiler Error when compiling rocket = "0.5.0-rc.1" #93831

jonaylor89 opened this issue Feb 9, 2022 · 6 comments · Fixed by #93893
Assignees
Labels
C-bug Category: This is a bug. P-critical Critical priority regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@jonaylor89
Copy link

Problem

When trying to build a project containing the rocket web framework, cargo fails with an internal compiler error. Below is the full error written to the console.

error: internal compiler error: encountered ambiguity selecting `Binder(<response::stream::reader::ReaderStream<impl futures::Stream<Item = response::stream::raw_sse::RawLinedEvent>> as std::convert::From<impl futures::Stream<Item = response::stream::raw_sse::RawLinedEvent>>>, [])` during codegen, presuming due to overflow or prior type error
  |
  = note: delayed at compiler/rustc_trait_selection/src/traits/codegen.rs:54:32

thread 'rustc' panicked at 'no errors encountered even though `delay_span_bug` issued', compiler/rustc_errors/src/lib.rs:1176:13
stack backtrace:
   0:     0x7f63127a59fc - std::backtrace_rs::backtrace::libunwind::trace::hef696c91488c46df
                               at /rustc/0c292c9667f1b202a9150d58bdd2e89e3e803996/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7f63127a59fc - std::backtrace_rs::backtrace::trace_unsynchronized::h76c93ef0698d26b2
                               at /rustc/0c292c9667f1b202a9150d58bdd2e89e3e803996/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f63127a59fc - std::sys_common::backtrace::_print_fmt::h93575aa503bf6e1b
                               at /rustc/0c292c9667f1b202a9150d58bdd2e89e3e803996/library/std/src/sys_common/backtrace.rs:66:5
   3:     0x7f63127a59fc - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h40967adecfbc037b
                               at /rustc/0c292c9667f1b202a9150d58bdd2e89e3e803996/library/std/src/sys_common/backtrace.rs:45:22
   4:     0x7f63128070dc - core::fmt::write::h03044e853df7d223
                               at /rustc/0c292c9667f1b202a9150d58bdd2e89e3e803996/library/core/src/fmt/mod.rs:1190:17
   5:     0x7f6312795d28 - std::io::Write::write_fmt::h86bffabfad56f13c
                               at /rustc/0c292c9667f1b202a9150d58bdd2e89e3e803996/library/std/src/io/mod.rs:1657:15
   6:     0x7f63127a9977 - std::sys_common::backtrace::_print::hd28d8aed16472cc0
                               at /rustc/0c292c9667f1b202a9150d58bdd2e89e3e803996/library/std/src/sys_common/backtrace.rs:48:5
   7:     0x7f63127a9977 - std::sys_common::backtrace::print::h8f98cdd641cb45a3
                               at /rustc/0c292c9667f1b202a9150d58bdd2e89e3e803996/library/std/src/sys_common/backtrace.rs:35:9
   8:     0x7f63127a9977 - std::panicking::default_hook::{{closure}}::h729dcf0a13bd0685
                               at /rustc/0c292c9667f1b202a9150d58bdd2e89e3e803996/library/std/src/panicking.rs:295:22
   9:     0x7f63127a963f - std::panicking::default_hook::h5f6c637024d9ad69
                               at /rustc/0c292c9667f1b202a9150d58bdd2e89e3e803996/library/std/src/panicking.rs:314:9
  10:     0x7f6312f8b681 - rustc_driver[a83f25a8e01ca780]::DEFAULT_HOOK::{closure#0}::{closure#0}
  11:     0x7f62fd852f63 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h15874327c724c4f1
                               at /rustc/0c292c9667f1b202a9150d58bdd2e89e3e803996/library/alloc/src/boxed.rs:1868:9
  12:     0x7f62fd93048c - proc_macro::bridge::client::<impl proc_macro::bridge::Bridge>::enter::{{closure}}::{{closure}}::hf4f8cfaa5a8904e5
                               at /rustc/0c292c9667f1b202a9150d58bdd2e89e3e803996/library/proc_macro/src/bridge/client.rs:319:21
  13:     0x7f62fd85b740 - std::panicking::update_hook::{{closure}}::hb7d2a3b785fe4df6
                               at /rustc/0c292c9667f1b202a9150d58bdd2e89e3e803996/library/std/src/panicking.rs:258:41
  14:     0x7f63127aa255 - std::panicking::rust_panic_with_hook::h46cff6766bf99e7c
                               at /rustc/0c292c9667f1b202a9150d58bdd2e89e3e803996/library/std/src/panicking.rs:702:17
  15:     0x7f63127a9f07 - std::panicking::begin_panic_handler::{{closure}}::h0e775b2aa2b67693
                               at /rustc/0c292c9667f1b202a9150d58bdd2e89e3e803996/library/std/src/panicking.rs:588:13
  16:     0x7f63127a5ea4 - std::sys_common::backtrace::__rust_end_short_backtrace::h1863dd104b065b9d
                               at /rustc/0c292c9667f1b202a9150d58bdd2e89e3e803996/library/std/src/sys_common/backtrace.rs:138:18
  17:     0x7f63127a9c09 - rust_begin_unwind
                               at /rustc/0c292c9667f1b202a9150d58bdd2e89e3e803996/library/std/src/panicking.rs:584:5
  18:     0x7f6312771b93 - core::panicking::panic_fmt::hfdeb0fcb6ce506f4
                               at /rustc/0c292c9667f1b202a9150d58bdd2e89e3e803996/library/core/src/panicking.rs:143:14
  19:     0x7f631407c60c - core[efe43fe86f1c620a]::panicking::panic_display::<&str>
  20:     0x7f63156f73dd - <rustc_errors[6e799cab4439a167]::HandlerInner>::flush_delayed
  21:     0x7f63156f589d - <rustc_errors[6e799cab4439a167]::HandlerInner as core[efe43fe86f1c620a]::ops::drop::Drop>::drop
  22:     0x7f6314e1d5e6 - core[efe43fe86f1c620a]::ptr::drop_in_place::<rustc_session[3b88a4bcbf196e76]::parse::ParseSess>
  23:     0x7f6314e1ffda - <alloc[61df3a55352cbfc0]::rc::Rc<rustc_session[3b88a4bcbf196e76]::session::Session> as core[efe43fe86f1c620a]::ops::drop::Drop>::drop
  24:     0x7f6314e102ac - core[efe43fe86f1c620a]::ptr::drop_in_place::<rustc_interface[9582d0c3479cfa46]::interface::Compiler>
  25:     0x7f6314e10ac1 - rustc_span[20d03c4744d90449]::with_source_map::<core[efe43fe86f1c620a]::result::Result<(), rustc_errors[6e799cab4439a167]::ErrorReported>, rustc_interface[9582d0c3479cfa46]::interface::create_compiler_and_run<core[efe43fe86f1c620a]::result::Result<(), rustc_errors[6e799cab4439a167]::ErrorReported>, rustc_driver[a83f25a8e01ca780]::run_compiler::{closure#1}>::{closure#1}>
  26:     0x7f6314e0d2d3 - rustc_interface[9582d0c3479cfa46]::interface::create_compiler_and_run::<core[efe43fe86f1c620a]::result::Result<(), rustc_errors[6e799cab4439a167]::ErrorReported>, rustc_driver[a83f25a8e01ca780]::run_compiler::{closure#1}>
  27:     0x7f6314df34e2 - std[3d6e7d7423cf4afe]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[9582d0c3479cfa46]::util::setup_callbacks_and_run_in_thread_pool_with_globals<rustc_interface[9582d0c3479cfa46]::interface::run_compiler<core[efe43fe86f1c620a]::result::Result<(), rustc_errors[6e799cab4439a167]::ErrorReported>, rustc_driver[a83f25a8e01ca780]::run_compiler::{closure#1}>::{closure#0}, core[efe43fe86f1c620a]::result::Result<(), rustc_errors[6e799cab4439a167]::ErrorReported>>::{closure#0}, core[efe43fe86f1c620a]::result::Result<(), rustc_errors[6e799cab4439a167]::ErrorReported>>
  28:     0x7f6314df0c29 - <<std[3d6e7d7423cf4afe]::thread::Builder>::spawn_unchecked_<rustc_interface[9582d0c3479cfa46]::util::setup_callbacks_and_run_in_thread_pool_with_globals<rustc_interface[9582d0c3479cfa46]::interface::run_compiler<core[efe43fe86f1c620a]::result::Result<(), rustc_errors[6e799cab4439a167]::ErrorReported>, rustc_driver[a83f25a8e01ca780]::run_compiler::{closure#1}>::{closure#0}, core[efe43fe86f1c620a]::result::Result<(), rustc_errors[6e799cab4439a167]::ErrorReported>>::{closure#0}, core[efe43fe86f1c620a]::result::Result<(), rustc_errors[6e799cab4439a167]::ErrorReported>>::{closure#1} as core[efe43fe86f1c620a]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  29:     0x7f63127b5ca3 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hf9ab37ec9b510857
                               at /rustc/0c292c9667f1b202a9150d58bdd2e89e3e803996/library/alloc/src/boxed.rs:1854:9
  30:     0x7f63127b5ca3 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::ha1991051ebf83b9d
                               at /rustc/0c292c9667f1b202a9150d58bdd2e89e3e803996/library/alloc/src/boxed.rs:1854:9
  31:     0x7f63127b5ca3 - std::sys::unix::thread::Thread::new::thread_start::h5d1d180c2a38668b
                               at /rustc/0c292c9667f1b202a9150d58bdd2e89e3e803996/library/std/src/sys/unix/thread.rs:108:17
  32:     0x7f6312554927 - start_thread
                               at ./nptl/./nptl/pthread_create.c:435:8
  33:     0x7f63125e49e4 - __clone
                               at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone.S:100
  34:                0x0 - <unknown>

error: internal compiler error: unexpected panic

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.60.0-nightly (0c292c966 2022-02-08) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type lib -C embed-bitcode=no -C debuginfo=2

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

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

Steps

  1. Create new cargo project cargo new random
  2. Add rocket to the dependencies rocket = "0.5.0-rc.1"
  3. Build the project cargo build

Possible Solution(s)

So far, the only solution I've found is to downgrade my version of nightly rust which'll compile the project just fine

Notes

No response

Version

cargo 1.60.0-nightly (25fcb13 2022-02-01)
release: 1.60.0-nightly
commit-hash: 25fcb135d02ea897ce894b67ae021f48107d522b
commit-date: 2022-02-01
host: x86_64-unknown-linux-gnu
libgit2: 1.3.0 (sys:0.13.23 vendored)
libcurl: 7.80.0-DEV (sys:0.4.51+curl-7.80.0 vendored ssl:OpenSSL/1.1.1l)
os: Pop!_OS 21.10 (impish) [64-bit]
@jonaylor89 jonaylor89 added the C-bug Category: This is a bug. label Feb 9, 2022
@Eh2406 Eh2406 transferred this issue from rust-lang/cargo Feb 9, 2022
@compiler-errors
Copy link
Member

this may be fallout from #92007, cc: @oli-obk

@oli-obk
Copy link
Contributor

oli-obk commented Feb 9, 2022

Huh... codegen should've revealed all opaque types, odd. Should be easy to fix if it's just a failure to reveal

@oli-obk oli-obk self-assigned this Feb 9, 2022
@oli-obk oli-obk added the regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. label Feb 9, 2022
@rustbot rustbot added the I-prioritize Issue: Indicates that prioritization has been requested for this issue. label Feb 9, 2022
@apiraino apiraino added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. I-prioritize Issue: Indicates that prioritization has been requested for this issue. and removed I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Feb 9, 2022
@apiraino
Copy link
Contributor

apiraino commented Feb 9, 2022

Assigning priority as discussed in the Zulip thread of the Prioritization Working Group.

@rustbot label -I-prioritize +P-critical

@rustbot rustbot added P-critical Critical priority and removed I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Feb 9, 2022
@oli-obk
Copy link
Contributor

oli-obk commented Feb 10, 2022

I made an MCVE

use std::fmt::Debug;

pub struct EventStream<S> {
    stream: S,
}

impl<S: Debug> EventStream<S> {
    fn into_stream(self) -> impl Debug {
        unimplemented!()
    }

    pub fn into_reader(self) -> impl Debug {
        ReaderStream::from(self.into_stream())
    }
}

#[derive(Debug)]
pub struct ReaderStream<S> {
    stream: S,
}

impl<S> From<S> for ReaderStream<S> {
    fn from(stream: S) -> Self {
        ReaderStream { stream }
    }
}

@oli-obk
Copy link
Contributor

oli-obk commented Feb 10, 2022

fix is up in #93859

@pro465
Copy link
Contributor

pro465 commented Feb 11, 2022

three people reacted with 🚀 in an issue using the Rocket framework.... boy do i love this community 😆 !

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. P-critical Critical priority regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
6 participants