Skip to content

ICE: panicked at 'explicit panic', compiler/rustc_errors/src/diagnostic_builder.rs:424:13 #85794

Closed
@chengniansun

Description

@chengniansun

Code

struct Baz {
  inner : dyn fn ()
}

Meta

rustc --version --verbose:

rustc 1.54.0-nightly (1c6868aa2 2021-05-27)
binary: rustc
commit-hash: 1c6868aa21981b37cbd3fc95828ee3b0ac22d494
commit-date: 2021-05-27
host: x86_64-unknown-linux-gnu
release: 1.54.0-nightly
LLVM version: 12.0.1

Error output

error: expected `,`, or `}`, found keyword `fn`
 --> mutant.rs:2:14
  |
2 |   inner : dyn fn ()
  |              ^ help: try adding a comma: `,`

error: internal compiler error: the following error was constructed but not emitted

error: expected identifier, found `(`
 --> mutant.rs:2:18
  |
2 |   inner : dyn fn ()
  |                  ^ expected identifier

thread 'rustc' panicked at 'explicit panic', compiler/rustc_errors/src/diagnostic_builder.rs:424:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

error: internal compiler error: unexpected panic

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

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.54.0-nightly (1c6868aa2 2021-05-27) running on x86_64-unknown-linux-gnu

query stack during panic:
end of query stack
error: aborting due to 3 previous errors
Backtrace

error: expected `,`, or `}`, found keyword `fn`
 --> mutant.rs:2:14
  |
2 |   inner : dyn fn ()
  |              ^ help: try adding a comma: `,`

error: internal compiler error: the following error was constructed but not emitted

error: expected identifier, found `(`
 --> mutant.rs:2:18
  |
2 |   inner : dyn fn ()
  |                  ^ expected identifier

thread 'rustc' panicked at 'explicit panic', compiler/rustc_errors/src/diagnostic_builder.rs:424:13
stack backtrace:
   0: std::panicking::begin_panic
   1: <rustc_errors::diagnostic_builder::DiagnosticBuilder as core::ops::drop::Drop>::drop
   2: rustc_parse::parser::item::<impl rustc_parse::parser::Parser>::parse_field_ident
   3: rustc_parse::parser::item::<impl rustc_parse::parser::Parser>::parse_field_def::{{closure}}
   4: rustc_parse::parser::item::<impl rustc_parse::parser::Parser>::parse_record_struct_body
   5: rustc_parse::parser::item::<impl rustc_parse::parser::Parser>::parse_item_kind
   6: rustc_parse::parser::item::<impl rustc_parse::parser::Parser>::parse_item_common
   7: rustc_parse::parser::item::<impl rustc_parse::parser::Parser>::parse_mod
   8: rustc_parse::parse_crate_from_file
   9: rustc_session::utils::<impl rustc_session::session::Session>::time
  10: rustc_interface::queries::Queries::parse
  11: rustc_span::with_session_globals
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

error: internal compiler error: unexpected panic

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

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.54.0-nightly (1c6868aa2 2021-05-27) running on x86_64-unknown-linux-gnu

query stack during panic:
end of query stack
error: aborting due to 3 previous errors

Metadata

Metadata

Labels

A-parserArea: The lexing & parsing of Rust source code to an ASTC-bugCategory: This is a bug.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.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.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions