Skip to content

ICE: FulfillmentError, MismatchedProjectionTypes #33461

Closed
@gmorenz

Description

@gmorenz

Testcase currently relying on the most recent ncollide and nphysics3d from crates.io. When I get some time later today I'll try to reduce it more.

Code:

extern crate ncollide;
extern crate nphysics3d;

use ncollide::shape::Ball;
use nphysics3d::object::RigidBody;

fn main() {
    RigidBody::new_dynamic(Ball::new(1.0f32), 1.0f32, 0.0f32, 1.0f32);
}

Error:

error: internal compiler error: ../src/librustc/infer/mod.rs:564: Encountered errors `[FulfillmentError(Obligation(predicate=Binder(ProjectionPredicate(ProjectionTy { trait_ref: <nalgebra::structs::vector::Vector3<f32> as ncollide::ncollide_math::Vector>, item_name: Scalar(3937) }, <<nalgebra::structs::point::Point3<f32> as ncollide::ncollide_math::Point>::Vect as ncollide::ncollide_math::Vector>::Scalar)),depth=2),MismatchedProjectionTypes(Sorts(ExpectedFound { expected: f32, found: <<nalgebra::structs::point::Point3<f32> as ncollide::ncollide_math::Point>::Vect as ncollide::ncollide_math::Vector>::Scalar })))]` fulfilling during trans
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

thread 'rustc' panicked at 'Box<Any>', ../src/libsyntax/errors/mod.rs:537
stack backtrace:
   1:     0x7fcc05a63610 - std::sys::backtrace::tracing::imp::write::h9fb600083204ae7f
   2:     0x7fcc05a70d5b - std::panicking::default_hook::_$u7b$$u7b$closure$u7d$$u7d$::hca543c34f11229ac
   3:     0x7fcc05a708fc - std::panicking::default_hook::hc2c969e7453d080c
   4:     0x7fcc05a3628f - std::sys_common::unwind::begin_unwind_inner::h30e12d15ce2b2e25
   5:     0x7fcc04538ea8 - std::sys_common::unwind::begin_unwind::h24c4c0fa2cfe995a
   6:     0x7fcc04538e4b - syntax::errors::Handler::span_bug::h1878d6587b8bfd95
   7:     0x7fcc0456dac2 - rustc::session::opt_span_bug_fmt::_$u7b$$u7b$closure$u7d$$u7d$::hf0fb5697f8f25f40
   8:     0x7fcc0456d9b2 - rustc::session::span_bug_fmt::h4591bcbadfc38558
   9:     0x7fcc0458204c - rustc_trans::common::fulfill_obligation::hb97500cd4d49823c
  10:     0x7fcc0457aa99 - rustc_trans::callee::Callee::def::ha169529fef0048b5
  11:     0x7fcc0467c11e - _<std..option..Option<T>>::map::h54e7f9a0f99f0360
  12:     0x7fcc0467bf0a - _<std..vec..Vec<T> as std..iter..FromIterator<T>>::from_iter::he173b9fb2f4cc1c2
  13:     0x7fcc0467b7c3 - rustc_trans::meth::get_vtable::_$u7b$$u7b$closure$u7d$$u7d$::hd7ec4b80d346f375
  14:     0x7fcc0467c942 - _<std..iter..FlatMap<I, U, F> as std..iter..Iterator>::next::ha090509351b98638
  15:     0x7fcc0467cb83 - _<std..vec..Vec<T>>::extend_desugared::hfc30acdd7688509c
  16:     0x7fcc0467c609 - core::iter::iterator::Iterator::collect::h42fa202d3651b5e6
  17:     0x7fcc0457c822 - rustc_trans::base::unsized_info::hd31be9e24e239b50
  18:     0x7fcc04641a66 - rustc_trans::expr::coerce_unsized::h6fa5deecc673f1b4
  19:     0x7fcc045eb860 - rustc_trans::expr::trans::h4425e9280a87b757
  20:     0x7fcc045a1faf - rustc_trans::expr::trans_into::he1315719b2222c7c
  21:     0x7fcc045a0d24 - rustc_trans::expr::trans_adt::hde3664923fa8f9ee
  22:     0x7fcc045a043d - rustc_trans::base::trans_named_tuple_constructor::hf968d51ee4f7b842
  23:     0x7fcc04579ab2 - rustc_trans::callee::Callee::call::h54d29fdb586ad3c4
  24:     0x7fcc0463e8b3 - rustc_trans::expr::trans_rvalue_dps_unadjusted::h4d8aac465b9b8fed
  25:     0x7fcc045a267d - rustc_trans::expr::trans_into::he1315719b2222c7c
  26:     0x7fcc0459a1cd - rustc_trans::controlflow::trans_block::h4fad28c271095568
  27:     0x7fcc04598c85 - rustc_trans::base::trans_closure::h83a389352ac0be25
  28:     0x7fcc0459a8f3 - rustc_trans::base::trans_fn::h9423938066432dd9
  29:     0x7fcc045d6fba - rustc_trans::callee::get_fn::h691a55e881985779
  30:     0x7fcc0457ad60 - rustc_trans::callee::Callee::def::ha169529fef0048b5
  31:     0x7fcc0467c11e - _<std..option..Option<T>>::map::h54e7f9a0f99f0360
  32:     0x7fcc0467bf0a - _<std..vec..Vec<T> as std..iter..FromIterator<T>>::from_iter::he173b9fb2f4cc1c2
  33:     0x7fcc0467b7c3 - rustc_trans::meth::get_vtable::_$u7b$$u7b$closure$u7d$$u7d$::hd7ec4b80d346f375
  34:     0x7fcc0467c942 - _<std..iter..FlatMap<I, U, F> as std..iter..Iterator>::next::ha090509351b98638
  35:     0x7fcc0467cb83 - _<std..vec..Vec<T>>::extend_desugared::hfc30acdd7688509c
  36:     0x7fcc0467c609 - core::iter::iterator::Iterator::collect::h42fa202d3651b5e6
  37:     0x7fcc0457c822 - rustc_trans::base::unsized_info::hd31be9e24e239b50
  38:     0x7fcc04641a66 - rustc_trans::expr::coerce_unsized::h6fa5deecc673f1b4
  39:     0x7fcc045eb860 - rustc_trans::expr::trans::h4425e9280a87b757
  40:     0x7fcc04645761 - rustc_trans::expr::trans_imm_cast::hf3533ccfb48f0b29
  41:     0x7fcc0463b828 - rustc_trans::expr::trans_unadjusted::hee333a5a427a7dc8
  42:     0x7fcc045eae31 - rustc_trans::expr::trans::h4425e9280a87b757
  43:     0x7fcc045e9bbe - rustc_trans::callee::trans_args::h9cc59c5a5b26cbc0
  44:     0x7fcc04579ec6 - rustc_trans::callee::Callee::call::h54d29fdb586ad3c4
  45:     0x7fcc0463e8b3 - rustc_trans::expr::trans_rvalue_dps_unadjusted::h4d8aac465b9b8fed
  46:     0x7fcc045a267d - rustc_trans::expr::trans_into::he1315719b2222c7c
  47:     0x7fcc045a0d24 - rustc_trans::expr::trans_adt::hde3664923fa8f9ee
  48:     0x7fcc0463d60a - rustc_trans::expr::trans_rvalue_dps_unadjusted::h4d8aac465b9b8fed
  49:     0x7fcc045a267d - rustc_trans::expr::trans_into::he1315719b2222c7c
  50:     0x7fcc0459a1cd - rustc_trans::controlflow::trans_block::h4fad28c271095568
  51:     0x7fcc04598c85 - rustc_trans::base::trans_closure::h83a389352ac0be25
  52:     0x7fcc0459a8f3 - rustc_trans::base::trans_fn::h9423938066432dd9
  53:     0x7fcc045d6fba - rustc_trans::callee::get_fn::h691a55e881985779
  54:     0x7fcc0457ad60 - rustc_trans::callee::Callee::def::ha169529fef0048b5
  55:     0x7fcc0463e671 - rustc_trans::expr::trans_rvalue_dps_unadjusted::h4d8aac465b9b8fed
  56:     0x7fcc0463b648 - rustc_trans::expr::trans_unadjusted::hee333a5a427a7dc8
  57:     0x7fcc045eae31 - rustc_trans::expr::trans::h4425e9280a87b757
  58:     0x7fcc045e9bbe - rustc_trans::callee::trans_args::h9cc59c5a5b26cbc0
  59:     0x7fcc04579ec6 - rustc_trans::callee::Callee::call::h54d29fdb586ad3c4
  60:     0x7fcc0463e8b3 - rustc_trans::expr::trans_rvalue_dps_unadjusted::h4d8aac465b9b8fed
  61:     0x7fcc045a267d - rustc_trans::expr::trans_into::he1315719b2222c7c
  62:     0x7fcc0459a1cd - rustc_trans::controlflow::trans_block::h4fad28c271095568
  63:     0x7fcc04598c85 - rustc_trans::base::trans_closure::h83a389352ac0be25
  64:     0x7fcc0459a8f3 - rustc_trans::base::trans_fn::h9423938066432dd9
  65:     0x7fcc045d6fba - rustc_trans::callee::get_fn::h691a55e881985779
  66:     0x7fcc0457ad60 - rustc_trans::callee::Callee::def::ha169529fef0048b5
  67:     0x7fcc0463e671 - rustc_trans::expr::trans_rvalue_dps_unadjusted::h4d8aac465b9b8fed
  68:     0x7fcc0463b648 - rustc_trans::expr::trans_unadjusted::hee333a5a427a7dc8
  69:     0x7fcc045eae31 - rustc_trans::expr::trans::h4425e9280a87b757
  70:     0x7fcc0461e166 - rustc_trans::controlflow::trans_stmt_semi::h1cfba097d89a5175
  71:     0x7fcc04599ea0 - rustc_trans::controlflow::trans_block::h4fad28c271095568
  72:     0x7fcc04598c85 - rustc_trans::base::trans_closure::h83a389352ac0be25
  73:     0x7fcc0459a8f3 - rustc_trans::base::trans_fn::h9423938066432dd9
  74:     0x7fcc045a4e91 - rustc_trans::base::trans_item::hdc785ae68a9e6500
  75:     0x7fcc045beecb - _<base..TransItemsWithinModVisitor<'a, 'tcx> as rustc..hir..intravisit..Visitor<'v>>::visit_item::h22c1c36dec64effa
  76:     0x7fcc045ad7cb - rustc_trans::base::trans_crate::h6ed1dbd6e572a8c2
  77:     0x7fcc05fc86ff - rustc_driver::driver::phase_4_translate_to_llvm::hd7579aae98641824
  78:     0x7fcc05fc6d8f - rustc_driver::driver::compile_input::_$u7b$$u7b$closure$u7d$$u7d$::he3c6b6ab9afe28dd
  79:     0x7fcc05fc3630 - rustc_driver::driver::phase_3_run_analysis_passes::_$u7b$$u7b$closure$u7d$$u7d$::h06c776ef4d1c70b6
  80:     0x7fcc05fbcf5e - rustc::ty::context::TyCtxt::create_and_enter::hb0e0e916c7274a64
  81:     0x7fcc05f8f90d - rustc_driver::driver::compile_input::h0629572e6f316b31
  82:     0x7fcc05f7053c - rustc_driver::run_compiler::h8902aebf8b1849a8
  83:     0x7fcc05f6dc41 - std::sys_common::unwind::try::try_fn::h4c74456035d0fcc7
  84:     0x7fcc05a60deb - __rust_try
  85:     0x7fcc05a60d7d - std::sys_common::unwind::inner_try::h47a4d9cd4a369dcd
  86:     0x7fcc05f6e48a - _<F as std..boxed..FnBox<A>>::call_box::h27f542a39f1d61ef
  87:     0x7fcc05a6eef4 - std::sys::thread::Thread::new::thread_start::h6f266e069bf4ec2b
  88:     0x7fcbfd7f6423 - start_thread
  89:     0x7fcc056cdcbc - clone
  90:                0x0 - <unknown>

error: Could not compile `pong`.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions