Skip to content

rustfmt: self.stashed_diagnostics.is_empty() #121517

Closed

Description

@matthiaskrgr

Code

trait Trait<'1> { s> {}

Meta

rustc --version --verbose:

rustfmt 1.7.0-nightly (52cea08 2024-02-23)


rustc 1.78.0-nightly (52cea084b 2024-02-23)
binary: rustc
commit-hash: 52cea084bd5bbac12ecfa5c0499f5c777025c968
commit-date: 2024-02-23
host: x86_64-unknown-linux-gnu
release: 1.78.0-nightly
LLVM version: 18.1.0

Error output

error: this file contains an unclosed delimiter
 --> /tmp/im/fmt.rs:2:2
  |
1 | trait Trait<'1> { s> {}
  |                 - unclosed delimiter
2 |
  |  ^
Backtrace


thread 'main' panicked at compiler/rustc_errors/src/lib.rs:565:9:
assertion failed: self.stashed_diagnostics.is_empty()
stack backtrace:
   0:     0x7f117c672af6 - std::backtrace_rs::backtrace::libunwind::trace::he0282bd7aa79d0f5
                               at /rustc/52cea084bd5bbac12ecfa5c0499f5c777025c968/library/std/src/../../backtrace/src/backtrace/libunwind.rs:104:5
   1:     0x7f117c672af6 - std::backtrace_rs::backtrace::trace_unsynchronized::hd257d30ae267ec37
                               at /rustc/52cea084bd5bbac12ecfa5c0499f5c777025c968/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f117c672af6 - std::sys_common::backtrace::_print_fmt::h4d76d87d5818822c
                               at /rustc/52cea084bd5bbac12ecfa5c0499f5c777025c968/library/std/src/sys_common/backtrace.rs:68:5
   3:     0x7f117c672af6 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hda8b13640513c0ca
                               at /rustc/52cea084bd5bbac12ecfa5c0499f5c777025c968/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7f117c6c3a7c - core::fmt::rt::Argument::fmt::h0e78e7472c6726f6
                               at /rustc/52cea084bd5bbac12ecfa5c0499f5c777025c968/library/core/src/fmt/rt.rs:142:9
   5:     0x7f117c6c3a7c - core::fmt::write::h92726084111378c3
                               at /rustc/52cea084bd5bbac12ecfa5c0499f5c777025c968/library/core/src/fmt/mod.rs:1120:17
   6:     0x7f117c6674bf - std::io::Write::write_fmt::hae4e2cfe04fc8ffe
                               at /rustc/52cea084bd5bbac12ecfa5c0499f5c777025c968/library/std/src/io/mod.rs:1846:15
   7:     0x7f117c6728a4 - std::sys_common::backtrace::_print::ha088f411ecf7b854
                               at /rustc/52cea084bd5bbac12ecfa5c0499f5c777025c968/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x7f117c6728a4 - std::sys_common::backtrace::print::h3cf71d8220ad62fb
                               at /rustc/52cea084bd5bbac12ecfa5c0499f5c777025c968/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x7f117c6755eb - std::panicking::default_hook::{{closure}}::h40fbaa4ba62f2a25
  10:     0x7f117c675339 - std::panicking::default_hook::h4bae8cc7cdeafbdc
                               at /rustc/52cea084bd5bbac12ecfa5c0499f5c777025c968/library/std/src/panicking.rs:292:9
  11:     0x7f11792859dc - std[67003dfa8d3cf222]::panicking::update_hook::<alloc[39168ee3c7236603]::boxed::Box<rustc_driver_impl[7f540b76ed15adf]::install_ice_hook::{closure#0}>>::{closure#0}
  12:     0x7f117c675d50 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h9766e5d4d8db67de
                               at /rustc/52cea084bd5bbac12ecfa5c0499f5c777025c968/library/alloc/src/boxed.rs:2030:9
  13:     0x7f117c675d50 - std::panicking::rust_panic_with_hook::h8e53bf6707538e9c
                               at /rustc/52cea084bd5bbac12ecfa5c0499f5c777025c968/library/std/src/panicking.rs:786:13
  14:     0x7f117c675a59 - std::panicking::begin_panic_handler::{{closure}}::h26d54e6ef9a6c6b8
                               at /rustc/52cea084bd5bbac12ecfa5c0499f5c777025c968/library/std/src/panicking.rs:652:13
  15:     0x7f117c672fd6 - std::sys_common::backtrace::__rust_end_short_backtrace::h820826df8359172f
                               at /rustc/52cea084bd5bbac12ecfa5c0499f5c777025c968/library/std/src/sys_common/backtrace.rs:171:18
  16:     0x7f117c6757c4 - rust_begin_unwind
                               at /rustc/52cea084bd5bbac12ecfa5c0499f5c777025c968/library/std/src/panicking.rs:648:5
  17:     0x7f117c6bff95 - core::panicking::panic_fmt::h8ddceedf455eb6ab
                               at /rustc/52cea084bd5bbac12ecfa5c0499f5c777025c968/library/core/src/panicking.rs:72:14
  18:     0x7f117c6c0053 - core::panicking::panic::h2937174c0915040f
                               at /rustc/52cea084bd5bbac12ecfa5c0499f5c777025c968/library/core/src/panicking.rs:144:5
  19:     0x7f117bbddbdb - <rustc_errors[69afeb585d680721]::DiagCtxtInner as core[e4f656a50871fc5f]::ops::drop::Drop>::drop.cold.0
  20:     0x564134bcb50b - core[e4f656a50871fc5f]::ptr::drop_in_place::<rustfmt_nightly[734c678f573b2d80]::parse::session::ParseSess>
  21:     0x564134bd2cc0 - <rustfmt_nightly[734c678f573b2d80]::Session<std[67003dfa8d3cf222]::io::stdio::Stdout>>::format_input_inner::{closure#0}
  22:     0x564134be8dd1 - rustfmt[40fef13c054501be]::format_and_emit_report::<std[67003dfa8d3cf222]::io::stdio::Stdout>
  23:     0x564134be726c - rustfmt[40fef13c054501be]::execute
  24:     0x564134be293b - rustfmt[40fef13c054501be]::main
  25:     0x564134bcd023 - std[67003dfa8d3cf222]::sys_common::backtrace::__rust_begin_short_backtrace::<fn(), ()>
  26:     0x564134bcf2c9 - std[67003dfa8d3cf222]::rt::lang_start::<()>::{closure#0}
  27:     0x7f117c657f83 - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::h369d12c4942e7526
                               at /rustc/52cea084bd5bbac12ecfa5c0499f5c777025c968/library/core/src/ops/function.rs:284:13
  28:     0x7f117c657f83 - std::panicking::try::do_call::h951a588450e41da0
                               at /rustc/52cea084bd5bbac12ecfa5c0499f5c777025c968/library/std/src/panicking.rs:555:40
  29:     0x7f117c657f83 - std::panicking::try::h45c068d6d7241dfb
                               at /rustc/52cea084bd5bbac12ecfa5c0499f5c777025c968/library/std/src/panicking.rs:519:19
  30:     0x7f117c657f83 - std::panic::catch_unwind::h7e2d0c5ea10dda27
                               at /rustc/52cea084bd5bbac12ecfa5c0499f5c777025c968/library/std/src/panic.rs:142:14
  31:     0x7f117c657f83 - std::rt::lang_start_internal::{{closure}}::hba10876b1ebd8163
                               at /rustc/52cea084bd5bbac12ecfa5c0499f5c777025c968/library/std/src/rt.rs:148:48
  32:     0x7f117c657f83 - std::panicking::try::do_call::h4de9141859218b0f
                               at /rustc/52cea084bd5bbac12ecfa5c0499f5c777025c968/library/std/src/panicking.rs:555:40
  33:     0x7f117c657f83 - std::panicking::try::h2528c2b62a63cf2f
                               at /rustc/52cea084bd5bbac12ecfa5c0499f5c777025c968/library/std/src/panicking.rs:519:19
  34:     0x7f117c657f83 - std::panic::catch_unwind::h7b8241c110740d48
                               at /rustc/52cea084bd5bbac12ecfa5c0499f5c777025c968/library/std/src/panic.rs:142:14
  35:     0x7f117c657f83 - std::rt::lang_start_internal::h65f44bcaf429c087
                               at /rustc/52cea084bd5bbac12ecfa5c0499f5c777025c968/library/std/src/rt.rs:148:20
  36:     0x564134be9f95 - main
  37:     0x7f1176158cd0 - <unknown>
  38:     0x7f1176158d8a - __libc_start_main
  39:     0x564134bbc699 - <unknown>
  40:                0x0 - <unknown>

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 `/tmp/im/rustc-ice-2024-02-23T17_30_19-757026.txt` to your bug report

query stack during panic:
end of query stack

Activity

  1. added
    I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
    C-bugCategory: This is a bug.
    on Feb 23, 2024
  2. added
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Feb 23, 2024
  3. matthiaskrgr commented on Feb 23, 2024

    @matthiaskrgr
    MemberAuthor
  4. nnethercote commented on Feb 23, 2024

    @nnethercote
    Contributor

    Probably a duplicate of #121450, and hopefully will be fixed by #121487.

  5. matthiaskrgr commented on Feb 23, 2024

    @matthiaskrgr
    MemberAuthor

    no, I checked, while #121450 is fixed, this one isn't :(

  6. added
    A-diagnosticsArea: Messages for errors, warnings, and lints
    and removed
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Feb 25, 2024
  7. added a commit that references this issue on Feb 25, 2024
    bf7d1b5
  8. added a commit that references this issue on Feb 26, 2024
    9d5ab73
  9. added a commit that references this issue on Feb 26, 2024
    f0573e1
  10. added 2 commits that reference this issue on Jun 22, 2024
    90af751
    c18226d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsC-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions