Skip to content

thread 'main' panicked at 'bad span: .: )', src/tools/rustfmt/src/source_map.rs:52:13 #3685

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
thedavidmeister opened this issue Jul 14, 2019 · 5 comments

Comments

@thedavidmeister
Copy link

thedavidmeister commented Jul 14, 2019

[nix-shell:~/holochain-rust]$ RUST_BACKTRACE=full hn-rust-fmt-check
checking rust formatting
thread 'main' panicked at 'bad span: `.`: `)`', src/tools/rustfmt/src/source_map.rs:52:13
stack backtrace:
   0:     0x56270fe13a1b - backtrace::backtrace::libunwind::trace::hd4effc5cbc99af65
                               at /cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/backtrace-0.3.29/src/backtrace/libunwind.rs:88
   1:     0x56270fe13a1b - backtrace::backtrace::trace_unsynchronized::h389cccb5967fa3c2
                               at /cargo/registry/src/github.1485827954.workers.dev-1ecc6299db9ec823/backtrace-0.3.29/src/backtrace/mod.rs:66
   2:     0x56270fe13a1b - std::sys_common::backtrace::_print::hbb606689fb98322f
                               at src/libstd/sys_common/backtrace.rs:47
   3:     0x56270fe13a1b - std::sys_common::backtrace::print::h2b6171d791ff1fac
                               at src/libstd/sys_common/backtrace.rs:36
   4:     0x56270fe13a1b - std::panicking::default_hook::{{closure}}::h7c4f6f6170cc3cf6
                               at src/libstd/panicking.rs:200
   5:     0x56270fe136f7 - std::panicking::default_hook::hd9f23e1c4cbbedcb
                               at src/libstd/panicking.rs:214
   6:     0x56270fe14190 - std::panicking::rust_panic_with_hook::h7fedb25d8f7a616a
                               at src/libstd/panicking.rs:477
   7:     0x56270fe13d12 - std::panicking::continue_panic_fmt::hed2a79ffb3c5014c
                               at src/libstd/panicking.rs:384
   8:     0x56270fe13c5f - std::panicking::begin_panic_fmt::h2023366d69573b0b
                               at src/libstd/panicking.rs:339
   9:     0x56270facfc11 - <rustfmt_nightly::visitor::SnippetProvider as rustfmt_nightly::source_map::SpanUtils>::span_before::{{closure}}::h1ce7b681d0fc162e
  10:     0x56270facfb7d - <rustfmt_nightly::visitor::SnippetProvider as rustfmt_nightly::source_map::SpanUtils>::span_before::h212baed30fae8ae4
  11:     0x56270fb3034f - rustfmt_nightly::chains::rewrite_chain::hf34c6545c9967830
  12:     0x56270fbaa971 - rustfmt_nightly::expr::format_expr::hc21af14c5d8190d3
  13:     0x56270fac1842 - <rustfmt_nightly::matches::ArmWrapper as rustfmt_nightly::rewrite::Rewrite>::rewrite::h2d91694ffd62bc24
  14:     0x56270fabcabb - <rustfmt_nightly::lists::ListItems<I,F1,F2,F3> as core::iter::traits::iterator::Iterator>::next::h880147405c2ccb87
  15:     0x56270fb0f481 - <alloc::vec::Vec<T> as alloc::vec::SpecExtend<T,I>>::from_iter::h713cecf2a347ee8b
  16:     0x56270fac32b5 - rustfmt_nightly::matches::rewrite_match::h5f72881b4c670647
  17:     0x56270fbac9ca - rustfmt_nightly::expr::format_expr::hc21af14c5d8190d3
  18:     0x56270fbbb1df - rustfmt_nightly::expr::rewrite_assign_rhs_with::h2fa7f6be0df17024
  19:     0x56270fb681bc - rustfmt_nightly::items::<impl rustfmt_nightly::rewrite::Rewrite for syntax::ast::Local>::rewrite::h3e7dd68f64f72653
  20:     0x56270fb67388 - rustfmt_nightly::expr::<impl rustfmt_nightly::rewrite::Rewrite for syntax::ast::Stmt>::rewrite::h3fa1674bf9fda94f
  21:     0x56270fadabe1 - rustfmt_nightly::visitor::FmtVisitor::walk_stmts::ha309a17e8f812ace
  22:     0x56270fad03d6 - rustfmt_nightly::visitor::FmtVisitor::visit_block::h1e0bc15d078cac67
  23:     0x56270fad1b5f - rustfmt_nightly::visitor::FmtVisitor::visit_fn::h51745510a3667a78
  24:     0x56270fad2bf6 - rustfmt_nightly::visitor::FmtVisitor::visit_item::h0fde04e8fe63c9aa
  25:     0x56270facf60d - rustfmt_nightly::reorder::<impl rustfmt_nightly::visitor::FmtVisitor>::visit_items_with_reordering::h91b639c336945309
  26:     0x56270fada866 - rustfmt_nightly::visitor::FmtVisitor::walk_mod_items::hbd7981fd487f6b46
  27:     0x56270fadb086 - rustfmt_nightly::visitor::FmtVisitor::format_separate_mod::hf5853482c24970ee
  28:     0x56270fa511fc - rustfmt_nightly::formatting::format_project::h7c90eee20a90825a
  29:     0x56270fa565ec - syntax::with_globals::h9371d6e03cf086a7
  30:     0x56270fa57f2e - rustfmt_nightly::Session<T>::format::h9a9879a18fd70e53
  31:     0x56270fa4ce6b - rustfmt::format_and_emit_report::ha64befa35ab01af7
  32:     0x56270fa578b9 - rustfmt_nightly::Session<T>::override_config::h33246ec9269a9c00
  33:     0x56270fa4a4d1 - rustfmt::execute::h1b7fe530e4133052
  34:     0x56270fa45fae - rustfmt::main::h3675fe441e483cd9
  35:     0x56270fa3cfb3 - std::rt::lang_start::{{closure}}::h764093f69dd5e625
  36:     0x56270fe13b93 - std::rt::lang_start_internal::{{closure}}::h79c18c14f3dd44f2
                               at src/libstd/rt.rs:49
  37:     0x56270fe13b93 - std::panicking::try::do_call::h5cf0ce76ce51ce37
                               at src/libstd/panicking.rs:296
  38:     0x56270fe166ba - __rust_maybe_catch_panic
                               at src/libpanic_unwind/lib.rs:82
  39:     0x56270fe1475d - std::panicking::try::hd2203b6be7f58203
                               at src/libstd/panicking.rs:275
  40:     0x56270fe1475d - std::panic::catch_unwind::hd14c478c815dd269
                               at src/libstd/panic.rs:394
  41:     0x56270fe1475d - std::rt::lang_start_internal::h7bf5a45e5970e0fb
                               at src/libstd/rt.rs:48
  42:     0x56270fa4d522 - main
  43:     0x7fe33cfddb8e - __libc_start_main
  44:     0x56270fa300b9 - <unknown>

using nightly 2019-07-14 on linux

@topecongiro
Copy link
Contributor

Thank you for the report. Does your code contain await!() macro call? If so, the issue could be a duplicate of #3666 and it is already fixed on the master. The version which includes the fix should be available within a week.

@thedavidmeister
Copy link
Author

@topecongiro
Copy link
Contributor

Thanks for conforming. Closing as a dup of #3666.

@thedavidmeister
Copy link
Author

@topecongiro wait what?

this isn't a dupe

my code does contain await! and i removed the ? and it is broken still

@topecongiro
Copy link
Contributor

#3666 is not specific to await!()?. rustfmt had crashed if there were await!() in any method chain.

The issue is fixed in 1.3.2 or later, so would you mind trying out the latest version, please? It should be available via rustup (there was a typo in CHANGELOG, sorry about that).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants