Skip to content

IllFormedSpan panic on servo/components/util/geometry.rs #281

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

Closed
jdm opened this issue Sep 6, 2015 · 3 comments
Closed

IllFormedSpan panic on servo/components/util/geometry.rs #281

jdm opened this issue Sep 6, 2015 · 3 comments
Labels
bug Panic, non-idempotency, invalid code, etc.

Comments

@jdm
Copy link
Contributor

jdm commented Sep 6, 2015

godot2:rustfmt jdm$ RUST_BACKTRACE=1 cargo run -- ../dev-servo/components/util/geometry.rs
     Running `target/debug/rustfmt ../dev-servo/components/util/geometry.rs`
thread '<main>' panicked at 'called `Result::unwrap()` on an `Err` value: IllFormedSpan(Span { lo: BytePos(7451), hi: BytePos(7450), expn_id: ExpnId(4294967295) })', ../src/libcore/result.rs:734
stack backtrace:
   1:        0x10d5f7820 - sys::backtrace::tracing::imp::write::h8eb606f0676b1c68Sqs
   2:        0x10d5fe889 - panicking::on_panic::h439344cab6a0722eKXw
   3:        0x10d5c0362 - rt::unwind::begin_unwind_inner::h208ecd91d43787c9Msw
   4:        0x10d5c10ed - rt::unwind::begin_unwind_fmt::hf44048ddc5eaca53Srw
   5:        0x10d5fe247 - rust_begin_unwind
   6:        0x10d6417d0 - panicking::panic_fmt::hd63ccd83aea7a95388E
   7:        0x1092310b7 - result::Result<T, E>::unwrap::h15314640174962089160
   8:        0x1092b1ce0 - lists::ListItems<'a, I, F1, F2, F3>.Iterator::next::closure.20716
   9:        0x1092b176c - option::Option<T>::map::h17176645871162808925
  10:        0x1092b16d9 - lists::ListItems<'a, I, F1, F2, F3>.Iterator::next::h7560221576871589207
  11:        0x1092b3c6e - vec::Vec<T>::extend_desugared::h13354835899793184531
  12:        0x1092b1513 - vec::Vec<T>.FromIterator<T>::from_iter::h7547116144876151375
  13:        0x1092b106a - iter::Iterator::collect::h13815661151036788661
  14:        0x1092ac0ec - types::rewrite_segment::ha28df370c6677e01SCd
  15:        0x1092ad07e - types::rewrite_path_segments::h17780008307551967566
  16:        0x1092aaf5a - types::rewrite_path::hcda5091361a19e2fhsd
  17:        0x1092aa64c - types::ast..Path.Rewrite::rewrite::h3d1545844aad2f19Prd
  18:        0x1092baee5 - types::ast..PolyTraitRef.Rewrite::rewrite::hc141dd9460d843e6rWd
  19:        0x1092b91a4 - types::ast..TyParamBound.Rewrite::rewrite::he9f129310ad10d17sSd
  20:        0x1092bc0a4 - types::ast..TyParam.Rewrite::rewrite::closure.20849
  21:        0x1092bc043 - ops::impls::_&'a mut F.FnOnce<A>::call_once::h11500830066270406417
  22:        0x1092bbfe1 - option::Option<T>::map::h7668302698510334225
  23:        0x1092bbf8e - iter::Map<I, F>.Iterator::next::h14998656755987981795
  24:        0x1092bc129 - vec::Vec<T>::extend_desugared::h10578532655587546008
  25:        0x1092bbe35 - vec::Vec<T>.FromIterator<T>::from_iter::h4647572910864055275
  26:        0x1092bbab3 - iter::Iterator::collect::h5422608003769980788
  27:        0x10929e720 - types::ast..TyParam.Rewrite::rewrite::h2144cce174465dfbOUd
  28:        0x10929e4e1 - items::FmtVisitor<'a>::rewrite_generics::closure.20368
  29:        0x1092a2be3 - ops::impls::_&'a mut F.FnOnce<A>::call_once::h16270146887670596768
  30:        0x1092a2b81 - option::Option<T>::map::h6136452969654757283
  31:        0x1092a2b2e - iter::Map<I, F>.Iterator::next::h2532431967054050753
  32:        0x1092a2997 - iter::Chain<A, B>.Iterator::next::h3949025344198176894
  33:        0x1092a268f - iter::Zip<A, B>.Iterator::next::closure.20431
  34:        0x1092a25f9 - option::Option<T>::and_then::h13521710487087644366
  35:        0x1092a25b2 - iter::Zip<A, B>.Iterator::next::h5868006234331496979
  36:        0x1092846b9 - items::FmtVisitor<'a>::rewrite_generics::h4bf268a869404095hsc
  37:        0x109281bf8 - items::FmtVisitor<'a>::rewrite_fn_base::h640c77219f0762c6ROb
  38:        0x10927625b - items::FmtVisitor<'a>::rewrite_fn::hb039c3f4fc23af3e2Lb
  39:        0x109275d97 - visitor::FmtVisitor<'a>.visit..Visitor<'v>::visit_fn::hafaaec5d358e831e4mb
  40:        0x10927711b - visit::walk_item::h10534217506031461571
  41:        0x109274406 - visitor::FmtVisitor<'a>.visit..Visitor<'v>::visit_item::hd1da70b37887b060lpb
  42:        0x1092781df - visit::walk_mod::h1125287194072707476
  43:        0x10927e9b5 - visitor::FmtVisitor<'a>::format_separate_mod::h22d0900753d58d91qBb
  44:        0x1092fe5e6 - fmt_ast::h759f48c893211f4epgh
  45:        0x10930d056 - RustFmtCalls.CompilerCalls<'a>::build_controller::closure.22601
  46:        0x109677652 - driver::compile_input::h1ec73c05d7d54684Yba
  47:        0x1097dc540 - run_compiler::h811f379afdcf695aeqc
  48:        0x10930d8bb - run::h3bee472aea2031c4Csh
  49:        0x10922b59a - execute::hc510df4f3732cd65Hca
  50:        0x10922e470 - main::hed5a22649aaadd6d1da
  51:        0x10d5ff712 - rt::unwind::try::try_fn::h1764332281185131786
  52:        0x10d5fe1f8 - __rust_try
  53:        0x10d5ff552 - rt::lang_start::h136aeed49f9e07e9OTw
  54:        0x10922fb09 - main
An unknown error occurred
@nrc nrc added the bug Panic, non-idempotency, invalid code, etc. label Sep 6, 2015
@jdm
Copy link
Contributor Author

jdm commented Sep 6, 2015

Here's the bit that breaks it:

pub fn rect_contains_point<T: PartialOrd + Add<T, Output=T>>(rect: Rect<T>, point: Point2D<T>) -> bool {
    point.x >= rect.origin.x && point.x < rect.origin.x + rect.size.width &&
        point.y >= rect.origin.y && point.y < rect.origin.y + rect.size.height
}

The <T: PartialOrd + Add<T, Output=T>> is making it choke for some reason.

@marcusklaas
Copy link
Contributor

This is a known bug, I think.

@marcusklaas
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Panic, non-idempotency, invalid code, etc.
Projects
None yet
Development

No branches or pull requests

3 participants