Skip to content

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

Closed
rust-lang/rust
#121301

Description

@aDifferentJT

rustc-ice-2024-02-19T01_32_59-84679.txt

Sorry, not a very helpful bug report, but it said to open an issue

Activity

  1. ytmimi commented on Feb 19, 2024

    @ytmimi
    Contributor

    No worries. What version of rustfmt are you using?

  2. ytmimi commented on Feb 19, 2024

    @ytmimi
    Contributor

    @aDifferentJT Do you also have an input snippet that we could run rustfmt on to reproduce the issue?

  3. aDifferentJT commented on Feb 19, 2024

    @aDifferentJT
    Author

    No worries. What version of rustfmt are you using?

    The latest nightly, I ran rustup update about an hour ago.

  4. aDifferentJT commented on Feb 19, 2024

    @aDifferentJT
    Author

    @aDifferentJT Do you also have an input snippet that we could run rustfmt on to reproduce the issue?

    Not to hand unfortunately, I haven't yet tried to narrow down the code that causes it, I'll try to do that in the morning, it's quite late here.

  5. ytmimi commented on Feb 19, 2024

    @ytmimi
    Contributor

    @aDifferentJT I don't think this is an issue with a particular code snippet. If I had to guess Id say changes made in rust-lang/rust#121085 are causing this issue.

  6. ytmimi commented on Feb 19, 2024

    @ytmimi
    Contributor

    were you running rustfmt on a public repo? That might be enough to reproduce the issue.

  7. aDifferentJT commented on Feb 19, 2024

    @aDifferentJT
    Author

    were you running rustfmt on a public repo? That might be enough to reproduce the issue.

    Sorry, no, it's private for now, if I get time in the morning I'll try to get a more minimal case I can send

  8. aDifferentJT commented on Feb 19, 2024

    @aDifferentJT
    Author

    I've minimised the file, this seems to be the smallest file that causes the issue

    rustfmt_ice.rs

    macro_rules! test {
        ($T:ident, $b:lifetime) => {
            Box<$T<$b>>
        };
    }
    
  9. ytmimi commented on Feb 19, 2024

    @ytmimi
    Contributor

    Perfect! I'm also able to reproduce the bug using the snippet. Thank you very much! I think this will help us figure out what's going on.

  10. ytmimi commented on Feb 23, 2024

    @ytmimi
    Contributor

    rust-lang/rust#121487 doesn't explicitly reference this issue, but I'm hoping that it also resolves the problem 🤞🏼

  11. added 5 commits that reference this issue on Mar 5, 2024
    e4da0d3
    15a6822
    201078a
    8aa21bd
    9153451
  12. added a commit that references this issue on Mar 6, 2024
    519e50e
  13. ytmimi commented on Mar 7, 2024

    @ytmimi
    Contributor

    @aDifferentJT when you have a moment can you confirm that this is resolved on the latest nightly (rustfmt 1.7.0-nightly (7d3702e4 2024-03-06)? I just ran your input snippet with a few recent nighty versions, and I can no longer reproduce the panic using the most recent nightly.

    steps to verify:

    1. rustup install nightly or rustup install nightly-2024-03-07
    2. rustfmt +nightly
  14. aDifferentJT commented on Mar 8, 2024

    @aDifferentJT
    Author

    @ytmimi Looks like it's working, thanks

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions