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

BUG: End of Query Stack #6104

Closed
grantkee opened this issue Mar 4, 2024 · 3 comments
Closed

BUG: End of Query Stack #6104

grantkee opened this issue Mar 4, 2024 · 3 comments

Comments

@grantkee
Copy link

grantkee commented Mar 4, 2024

Scenario:

I ran my usual cargo +nightly fmt using rustfmt 1.7.0-nightly (0ecbd060 2024-02-25). The compiler asked me to submit a bug report, so I decided to share.

Output

me@computer telcoin-network % cargo +nightly fmt
thread 'main' panicked at src/tools/rustfmt/src/parse/session.rs:42:9:
silent emitter attempted to translate a diagnostic
stack backtrace:
   0:        0x10373ef9c - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hab3f53d2d8212ddd
   1:        0x103783398 - core::fmt::write::h0d0a687663f48932
   2:        0x1037352c4 - std::io::Write::write_fmt::h79b31fb1b26d1d26
   3:        0x10373edd8 - std::sys_common::backtrace::print::h63e6d322e19f4801
   4:        0x1037416f8 - std::panicking::default_hook::{{closure}}::h9349ab3cdb5da91c
   5:        0x1037413dc - std::panicking::default_hook::h38cfb5d7f682af71
   6:        0x10cc57960 - std[11477bd025474483]::panicking::update_hook::<alloc[f9d6debfd87887c]::boxed::Box<rustc_driver_impl[55162aa11c5af315]::install_ice_hook::{closure#0}>>::{closure#0}
   7:        0x10374212c - std::panicking::rust_panic_with_hook::hba6149685af3b41f
   8:        0x103741ac4 - std::panicking::begin_panic_handler::{{closure}}::h43fe5d8d89dcb2a4
   9:        0x10373f428 - std::sys_common::backtrace::__rust_end_short_backtrace::h85585bc7dd9092f8
  10:        0x103741868 - _rust_begin_unwind
  11:        0x10379c734 - core::panicking::panic_fmt::hfbac5bdaf98aee43
  12:        0x10259e904 - <rustfmt_nightly[364e0ee372b542d7]::parse::session::SilentEmitter as rustc_errors[ccfcc51380d11a84]::translation::Translate>::fallback_fluent_bundle
  13:        0x102593a68 - <rustfmt_nightly[364e0ee372b542d7]::parse::session::SilentOnIgnoredFilesEmitter as rustc_errors[ccfcc51380d11a84]::translation::Translate>::translate_message
  14:        0x10dc1a7d4 - <rustc_errors[ccfcc51380d11a84]::DiagCtxt>::eagerly_translate::<indexmap[6b8b594ed101e88a]::map::iter::Iter<alloc[f9d6debfd87887c]::borrow::Cow<str>, rustc_errors[ccfcc51380d11a84]::diagnostic::DiagnosticArgValue>>
  15:        0x10dbecb34 - <rustc_parse[f87f56ceb18719c7]::errors::UnknownTokenStart as rustc_errors[ccfcc51380d11a84]::diagnostic::IntoDiagnostic>::into_diagnostic
  16:        0x10dc13bc8 - <rustc_parse[f87f56ceb18719c7]::lexer::StringReader>::next_token
  17:        0x10dc10688 - <rustc_parse[f87f56ceb18719c7]::lexer::tokentrees::TokenTreesReader>::bump
  18:        0x10dc0f31c - <rustc_parse[f87f56ceb18719c7]::lexer::tokentrees::TokenTreesReader>::parse_token_trees
  19:        0x10dc0f3ac - <rustc_parse[f87f56ceb18719c7]::lexer::tokentrees::TokenTreesReader>::parse_token_trees
  20:        0x10dc0f10c - <rustc_parse[f87f56ceb18719c7]::lexer::tokentrees::TokenTreesReader>::parse_all_token_trees
  21:        0x10dc19b68 - rustc_parse[f87f56ceb18719c7]::maybe_file_to_stream
  22:        0x10dc19828 - rustc_parse[f87f56ceb18719c7]::maybe_source_file_to_parser
  23:        0x10251c984 - <rustfmt_nightly[364e0ee372b542d7]::parse::parser::Parser>::parse_crate
  24:        0x1025331e0 - rustfmt_nightly[364e0ee372b542d7]::formatting::format_project::<rustfmt_nightly[364e0ee372b542d7]::Session<alloc[f9d6debfd87887c]::vec::Vec<u8>>>
  25:        0x1024ca170 - <scoped_tls[3713af7c7bff24ad]::ScopedKey<rustc_span[d21793098b958899]::SessionGlobals>>::with::<<rustfmt_nightly[364e0ee372b542d7]::Session<alloc[f9d6debfd87887c]::vec::Vec<u8>>>::format_input_inner::{closure#0}, core[e0108a028e95754e]::result::Result<rustfmt_nightly[364e0ee372b542d7]::FormatReport, rustfmt_nightly[364e0ee372b542d7]::ErrorKind>>
  26:        0x102526a14 - rustc_span[d21793098b958899]::create_session_if_not_set_then::<core[e0108a028e95754e]::result::Result<rustfmt_nightly[364e0ee372b542d7]::FormatReport, rustfmt_nightly[364e0ee372b542d7]::ErrorKind>, <rustfmt_nightly[364e0ee372b542d7]::Session<alloc[f9d6debfd87887c]::vec::Vec<u8>>>::format_input_inner::{closure#0}>
  27:        0x102526cc4 - std[11477bd025474483]::panicking::try::<core[e0108a028e95754e]::option::Option<rustfmt_nightly[364e0ee372b542d7]::FormattedSnippet>, rustfmt_nightly[364e0ee372b542d7]::format_snippet::{closure#0}>
  28:        0x10251d554 - rustfmt_nightly[364e0ee372b542d7]::format_snippet
  29:        0x10251d94c - rustfmt_nightly[364e0ee372b542d7]::format_code_block
  30:        0x1025687c8 - <rustfmt_nightly[364e0ee372b542d7]::comment::CommentRewrite>::handle_line
  31:        0x102569920 - rustfmt_nightly[364e0ee372b542d7]::comment::rewrite_comment_inner
  32:        0x10256453c - rustfmt_nightly[364e0ee372b542d7]::comment::identify_comment
  33:        0x1025e4fa8 - rustfmt_nightly[364e0ee372b542d7]::attr::rewrite_initial_doc_comments
  34:        0x1024efc74 - <[rustc_ast[ed916f4dc90409f2]::ast::Attribute] as rustfmt_nightly[364e0ee372b542d7]::rewrite::Rewrite>::rewrite
  35:        0x1025f4fb0 - <rustfmt_nightly[364e0ee372b542d7]::visitor::FmtVisitor>::visit_attrs
  36:        0x1025f1f3c - <rustfmt_nightly[364e0ee372b542d7]::visitor::FmtVisitor>::visit_item
  37:        0x1025ebd20 - <rustfmt_nightly[364e0ee372b542d7]::visitor::FmtVisitor>::visit_items_with_reordering
  38:        0x1025f5e20 - <rustfmt_nightly[364e0ee372b542d7]::visitor::FmtVisitor>::format_separate_mod
  39:        0x102444cc8 - rustfmt_nightly[364e0ee372b542d7]::formatting::format_project::<rustfmt_nightly[364e0ee372b542d7]::Session<std[11477bd025474483]::io::stdio::Stdout>>
  40:        0x10243f0b4 - <scoped_tls[3713af7c7bff24ad]::ScopedKey<rustc_span[d21793098b958899]::SessionGlobals>>::with::<<rustfmt_nightly[364e0ee372b542d7]::Session<std[11477bd025474483]::io::stdio::Stdout>>::format_input_inner::{closure#0}, core[e0108a028e95754e]::result::Result<rustfmt_nightly[364e0ee372b542d7]::FormatReport, rustfmt_nightly[364e0ee372b542d7]::ErrorKind>>
  41:        0x10243d2b8 - <scoped_tls[3713af7c7bff24ad]::ScopedKey<rustc_span[d21793098b958899]::SessionGlobals>>::set::<rustc_span[d21793098b958899]::create_session_if_not_set_then<core[e0108a028e95754e]::result::Result<rustfmt_nightly[364e0ee372b542d7]::FormatReport, rustfmt_nightly[364e0ee372b542d7]::ErrorKind>, <rustfmt_nightly[364e0ee372b542d7]::Session<std[11477bd025474483]::io::stdio::Stdout>>::format_input_inner::{closure#0}>::{closure#0}, core[e0108a028e95754e]::result::Result<rustfmt_nightly[364e0ee372b542d7]::FormatReport, rustfmt_nightly[364e0ee372b542d7]::ErrorKind>>
  42:        0x102435840 - rustc_span[d21793098b958899]::create_session_if_not_set_then::<core[e0108a028e95754e]::result::Result<rustfmt_nightly[364e0ee372b542d7]::FormatReport, rustfmt_nightly[364e0ee372b542d7]::ErrorKind>, <rustfmt_nightly[364e0ee372b542d7]::Session<std[11477bd025474483]::io::stdio::Stdout>>::format_input_inner::{closure#0}>
  43:        0x10242be5c - rustfmt[e8c510bd0e8c5fe9]::format_and_emit_report::<std[11477bd025474483]::io::stdio::Stdout>
  44:        0x102441e00 - <rustfmt_nightly[364e0ee372b542d7]::Session<std[11477bd025474483]::io::stdio::Stdout>>::override_config::<rustfmt[e8c510bd0e8c5fe9]::format::{closure#0}, ()>
  45:        0x10242af60 - rustfmt[e8c510bd0e8c5fe9]::execute
  46:        0x102429468 - rustfmt[e8c510bd0e8c5fe9]::main
  47:        0x10243c534 - std[11477bd025474483]::sys_common::backtrace::__rust_begin_short_backtrace::<fn(), ()>
  48:        0x102446ad0 - std[11477bd025474483]::rt::lang_start::<()>::{closure#0}
  49:        0x103727e38 - std::rt::lang_start_internal::h91d67f00e21ccd3b
  50:        0x10242c92c - _main

error: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rustfmt/issues/new?labels=bug

note: please attach the file at `computer/rustc-ice-2024-03-04T14_19_20-1915.txt` to your bug report

query stack during panic:
end of query stack

File attachment for bug report

rustc-ice-2024-03-04T14_19_20-1915.txt

@grantkee
Copy link
Author

grantkee commented Mar 4, 2024

cargo clean did not fix the issue

@grantkee
Copy link
Author

grantkee commented Mar 4, 2024

I updated to rustc 1.78.0-nightly (516b6162a 2024-03-03) and got a similar error running cargo +nightly fmt

New File attachment

rustc-ice-2024-03-04T14_28_41-2172.txt

@ytmimi
Copy link
Contributor

ytmimi commented Mar 4, 2024

@grantkee thanks for the report. Given the error message I'm assuming this is a duplicate of #6082. Luckily work is underway to resolve this one and a fix will hopefully land on nightly soon 🤞🏼

thread 'main' panicked at src/tools/rustfmt/src/parse/session.rs:42:9:
silent emitter attempted to translate a diagnostic

@ytmimi ytmimi closed this as not planned Won't fix, can't repro, duplicate, stale Mar 4, 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