Skip to content

nightly compiler panicked: assertion failed: !(self.has_self && idx == 0)', src/librustc/ty/mod.rs:786:16 #45712

Closed
@d9n

Description

@d9n

Today (2017/11/1) I was curious about the rx project (https://github.com/ruuda/rx), so I decided to compile it. It uses #![features] so I downloaded lastest nightly.

 $ rustup show
Default host: x86_64-apple-darwin

... 
active toolchain
----------------

nightly-x86_64-apple-darwin (default)
rustc 1.23.0-nightly (2be4cc040 2017-11-01)

Trying to compile, I got an error about impl and trait definitions differing due to a 'static bound, so I changed src/observable.rs to:

# Line 63
     fn subscribe<O>(&mut self, observer: O) -> Self::Subscription
-        where O: Observer<Self::Item, Self::Error>;
+        where O: Observer<Self::Item, Self::Error> + 'static; 

And I got this:

 $ RUST_BACKTRACE=1 cargo build
   Compiling rx v0.0.1 (file:///Users/d9n/root/src/rust/rx)
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/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.23.0-nightly (2be4cc040 2017-11-01) running on x86_64-apple-darwin

note: run with `RUST_BACKTRACE=1` for a backtrace

thread 'rustc' panicked at 'assertion failed: !(self.has_self && idx == 0)', src/librustc/ty/mod.rs:786:16
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
stack backtrace:
   0: std::sys::imp::backtrace::tracing::imp::unwind_backtrace
   1: std::sys_common::backtrace::_print
   2: std::panicking::default_hook::{{closure}}
   3: std::panicking::default_hook
   4: std::panicking::rust_panic_with_hook
   5: std::panicking::begin_panic
   6: rustc::ty::Generics::type_param
   7: rustc::infer::error_reporting::<impl rustc::infer::InferCtxt<'a, 'gcx, 'tcx>>::report_region_errors
   8: rustc::infer::InferCtxt::resolve_regions_and_report_errors
   9: rustc_typeck::check::regionck::<impl rustc_typeck::check::FnCtxt<'a, 'gcx, 'tcx>>::regionck_fn
  10: <std::thread::local::LocalKey<T>>::with
  11: rustc::ty::context::GlobalCtxt::enter_local
  12: _ZN12rustc_typeck5check16typeck_tables_of17hdb9bcc875ada78f7E.llvm.84D1B754
  13: rustc::ty::maps::<impl rustc::ty::maps::queries::typeck_tables_of<'tcx>>::compute_result
  14: _ZN5rustc9dep_graph5graph8DepGraph14with_task_impl17h50ec4681f521ffdaE.llvm.8F0621FC
  15: rustc_errors::Handler::track_diagnostics
  16: rustc::ty::maps::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::cycle_check
  17: rustc::ty::maps::<impl rustc::ty::maps::queries::typeck_tables_of<'tcx>>::force
  18: rustc::ty::maps::<impl rustc::ty::maps::queries::typeck_tables_of<'tcx>>::try_get
  19: rustc::ty::maps::TyCtxtAt::typeck_tables_of
  20: rustc::ty::maps::<impl rustc::ty::maps::queries::typeck_tables_of<'tcx>>::ensure
  21: rustc::session::Session::track_errors
  22: _ZN12rustc_typeck5check18typeck_item_bodies17h2301b442e2fa9055E.llvm.84D1B754
  23: rustc::ty::maps::<impl rustc::ty::maps::queries::typeck_item_bodies<'tcx>>::compute_result
  24: _ZN5rustc9dep_graph5graph8DepGraph14with_task_impl17h3f03d4824cbc6e12E.llvm.8F0621FC
  25: rustc_errors::Handler::track_diagnostics
  26: rustc::ty::maps::plumbing::<impl rustc::ty::context::TyCtxt<'a, 'gcx, 'tcx>>::cycle_check
  27: rustc::ty::maps::<impl rustc::ty::maps::queries::typeck_item_bodies<'tcx>>::force
  28: rustc::ty::maps::<impl rustc::ty::maps::queries::typeck_item_bodies<'tcx>>::try_get
  29: rustc::ty::maps::TyCtxtAt::typeck_item_bodies
  30: rustc::ty::maps::<impl rustc::ty::context::TyCtxt<'a, 'tcx, 'lcx>>::typeck_item_bodies
  31: rustc::util::common::time
  32: rustc_typeck::check_crate
  33: <std::thread::local::LocalKey<T>>::with
  34: <std::thread::local::LocalKey<T>>::with
  35: rustc::ty::context::TyCtxt::create_and_enter
  36: rustc_driver::driver::compile_input
  37: rustc_driver::run_compiler

error: Could not compile `rx`.

Metadata

Metadata

Assignees

No one assigned

    Labels

    I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions