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

cargo +nightly fmt error #6090

Closed
supernovahs opened this issue Feb 24, 2024 · 2 comments
Closed

cargo +nightly fmt error #6090

supernovahs opened this issue Feb 24, 2024 · 2 comments

Comments

@supernovahs
Copy link

thread 'main' panicked at src/tools/rustfmt/src/parse/session.rs:42:9:
silent emitter attempted to translate a diagnostic
stack backtrace:
   0:        0x101c48144 - std::backtrace::Backtrace::create::h256217627b80cdbd
   1:        0x10b1c0a88 - std[35db171df217138c]::panicking::update_hook::<alloc[c6e243cbecd9122f]::boxed::Box<rustc_driver_impl[1bf557973cdc719f]::install_ice_hook::{closure#0}>>::{closure#0}
   2:        0x101c60ee4 - std::panicking::rust_panic_with_hook::hd3bc5c3697bff071
   3:        0x101c6087c - std::panicking::begin_panic_handler::{{closure}}::hbc804fa8fec1f081
   4:        0x101c5e1e0 - std::sys_common::backtrace::__rust_end_short_backtrace::h4ee9d5159f23371c
   5:        0x101c60620 - _rust_begin_unwind
   6:        0x101cbbadc - core::panicking::panic_fmt::h2ba3e5f79b77a45f
   7:        0x100e57904 - <rustfmt_nightly[8b3928c2bc97675d]::parse::session::SilentEmitter as rustc_errors[446ecdd8909798d]::translation::Translate>::fallback_fluent_bundle
   8:        0x100e55c04 - <rustfmt_nightly[8b3928c2bc97675d]::parse::session::SilentOnIgnoredFilesEmitter as rustc_errors[446ecdd8909798d]::translation::Translate>::translate_message
   9:        0x10c1819d0 - <rustc_errors[446ecdd8909798d]::DiagCtxt>::eagerly_translate::<indexmap[e73a5172dc32d604]::map::iter::Iter<alloc[c6e243cbecd9122f]::borrow::Cow<str>, rustc_errors[446ecdd8909798d]::diagnostic::DiagnosticArgValue>>
  10:        0x10c13b9dc - <rustc_parse[d404c25812033069]::errors::UnknownPrefix as rustc_errors[446ecdd8909798d]::diagnostic::IntoDiagnostic>::into_diagnostic
  11:        0x10c119890 - <rustc_parse[d404c25812033069]::lexer::StringReader>::report_unknown_prefix
  12:        0x10c116698 - <rustc_parse[d404c25812033069]::lexer::StringReader>::next_token
  13:        0x10c16fd60 - <rustc_parse[d404c25812033069]::lexer::tokentrees::TokenTreesReader>::bump
  14:        0x10c16ec24 - <rustc_parse[d404c25812033069]::lexer::tokentrees::TokenTreesReader>::parse_token_trees
  15:        0x10c16ecb0 - <rustc_parse[d404c25812033069]::lexer::tokentrees::TokenTreesReader>::parse_token_trees
  16:        0x10c16ea10 - <rustc_parse[d404c25812033069]::lexer::tokentrees::TokenTreesReader>::parse_all_token_trees
  17:        0x10c11c4e4 - rustc_parse[d404c25812033069]::maybe_file_to_stream
  18:        0x10c11c1a4 - rustc_parse[d404c25812033069]::maybe_source_file_to_parser
  19:        0x100e6dc04 - <rustfmt_nightly[8b3928c2bc97675d]::parse::parser::Parser>::parse_crate
  20:        0x100eb0480 - rustfmt_nightly[8b3928c2bc97675d]::formatting::format_project::<rustfmt_nightly[8b3928c2bc97675d]::Session<alloc[c6e243cbecd9122f]::vec::Vec<u8>>>
  21:        0x100edda8c - <scoped_tls[9ab5c67d09f21897]::ScopedKey<rustc_span[1bbdc5c46a383764]::SessionGlobals>>::with::<<rustfmt_nightly[8b3928c2bc97675d]::Session<alloc[c6e243cbecd9122f]::vec::Vec<u8>>>::format_input_inner::{closure#0}, core[86232531ee72a3db]::result::Result<rustfmt_nightly[8b3928c2bc97675d]::FormatReport, rustfmt_nightly[8b3928c2bc97675d]::ErrorKind>>
  22:        0x100e50b90 - rustc_span[1bbdc5c46a383764]::create_session_if_not_set_then::<core[86232531ee72a3db]::result::Result<rustfmt_nightly[8b3928c2bc97675d]::FormatReport, rustfmt_nightly[8b3928c2bc97675d]::ErrorKind>, <rustfmt_nightly[8b3928c2bc97675d]::Session<alloc[c6e243cbecd9122f]::vec::Vec<u8>>>::format_input_inner::{closure#0}>
  23:        0x100ea4f2c - std[35db171df217138c]::panicking::try::<core[86232531ee72a3db]::option::Option<rustfmt_nightly[8b3928c2bc97675d]::FormattedSnippet>, rustfmt_nightly[8b3928c2bc97675d]::format_snippet::{closure#0}>
  24:        0x100e6e898 - rustfmt_nightly[8b3928c2bc97675d]::format_snippet
  25:        0x100e6ec90 - rustfmt_nightly[8b3928c2bc97675d]::format_code_block
  26:        0x100ee53c0 - rustfmt_nightly[8b3928c2bc97675d]::comment::rewrite_comment_inner
  27:        0x100ee24f8 - rustfmt_nightly[8b3928c2bc97675d]::comment::identify_comment
  28:        0x100e13e6c - <rustfmt_nightly[8b3928c2bc97675d]::visitor::FmtVisitor>::process_comment
  29:        0x100e12f74 - <rustfmt_nightly[8b3928c2bc97675d]::visitor::FmtVisitor>::format_missing_indent
  30:        0x100e1d1cc - <rustfmt_nightly[8b3928c2bc97675d]::visitor::FmtVisitor>::push_rewrite
  31:        0x100e1e680 - <rustfmt_nightly[8b3928c2bc97675d]::visitor::FmtVisitor>::walk_stmts
  32:        0x100e1eae8 - <rustfmt_nightly[8b3928c2bc97675d]::visitor::FmtVisitor>::walk_stmts
  33:        0x100e18620 - <rustfmt_nightly[8b3928c2bc97675d]::visitor::FmtVisitor>::visit_block
  34:        0x100e1a8bc - <rustfmt_nightly[8b3928c2bc97675d]::visitor::FmtVisitor>::visit_fn
  35:        0x100e1c5e8 - <rustfmt_nightly[8b3928c2bc97675d]::visitor::FmtVisitor>::visit_assoc_item
  36:        0x100e11240 - <rustfmt_nightly[8b3928c2bc97675d]::visitor::FmtVisitor>::visit_impl_items
  37:        0x100f08a74 - rustfmt_nightly[8b3928c2bc97675d]::items::format_impl
  38:        0x100e1f028 - <rustfmt_nightly[8b3928c2bc97675d]::visitor::FmtVisitor>::with_context::<<rustfmt_nightly[8b3928c2bc97675d]::visitor::FmtVisitor>::visit_item::{closure#0}>
  39:        0x100e1b614 - <rustfmt_nightly[8b3928c2bc97675d]::visitor::FmtVisitor>::visit_item
  40:        0x100e14c78 - <rustfmt_nightly[8b3928c2bc97675d]::visitor::FmtVisitor>::visit_items_with_reordering
  41:        0x100e1ed5c - <rustfmt_nightly[8b3928c2bc97675d]::visitor::FmtVisitor>::format_separate_mod
  42:        0x100d6b30c - rustfmt_nightly[8b3928c2bc97675d]::formatting::format_project::<rustfmt_nightly[8b3928c2bc97675d]::Session<std[35db171df217138c]::io::stdio::Stdout>>
  43:        0x100d7b488 - <scoped_tls[9ab5c67d09f21897]::ScopedKey<rustc_span[1bbdc5c46a383764]::SessionGlobals>>::with::<<rustfmt_nightly[8b3928c2bc97675d]::Session<std[35db171df217138c]::io::stdio::Stdout>>::format_input_inner::{closure#0}, core[86232531ee72a3db]::result::Result<rustfmt_nightly[8b3928c2bc97675d]::FormatReport, rustfmt_nightly[8b3928c2bc97675d]::ErrorKind>>
  44:        0x100d7c350 - <rustfmt_nightly[8b3928c2bc97675d]::Session<std[35db171df217138c]::io::stdio::Stdout>>::format_input_inner
  45:        0x100d6a214 - rustfmt[e5e5934501096cb0]::format_and_emit_report::<std[35db171df217138c]::io::stdio::Stdout>
  46:        0x100d79520 - <rustfmt_nightly[8b3928c2bc97675d]::Session<std[35db171df217138c]::io::stdio::Stdout>>::override_config::<rustfmt[e5e5934501096cb0]::format::{closure#0}, ()>
  47:        0x100d69344 - rustfmt[e5e5934501096cb0]::execute
  48:        0x100d6784c - rustfmt[e5e5934501096cb0]::main
  49:        0x100d74070 - std[35db171df217138c]::sys_common::backtrace::__rust_begin_short_backtrace::<fn(), ()>
  50:        0x100d812d8 - std[35db171df217138c]::rt::lang_start::<()>::{closure#0}
  51:        0x101c46bf0 - std::rt::lang_start_internal::h1a04710e0720890c
  52:        0x100d6acb0 - _main


rustc version: 1.78.0-nightly (8f359beca 2024-02-23)
platform: aarch64-apple-darwin

@supernovahs
Copy link
Author

Temporary workaround

rustup toolchain install nightly-2024-02-01
cargo +nightly-2024-02-01 fmt

thanks to @emhane

@feds01 feds01 mentioned this issue Feb 26, 2024
@ytmimi
Copy link
Contributor

ytmimi commented Feb 26, 2024

Thanks for the report! There were some changes made in the rust-lang/rust repo that are causing this issue in rustfmt. The panic message seems identical to #6082 so I'm going to close this one as a duplicate.

@ytmimi ytmimi closed this as not planned Won't fix, can't repro, duplicate, stale Feb 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants