Skip to content

TranslateError could have better formatting #107211

Open
@matthiaskrgr

Description

@matthiaskrgr

I'm not sure if this is intentional

error: expected expression, found `,`
 --> /home/matthias/vcs/github/glacier2/fixed/94629.rs:2:40
  |
2 |     fn a(){{{{({{{ExprKind::Use {});(]),}}
  |                                        ^ expected expression

thread 'rustc' panicked at 'called `Result::unwrap()` on an `Err` value: failed while formatting fluent string `parse_mismatched_closing_delimiter`:
message was missing
', compiler/rustc_errors/src/emitter.rs:1391:84
stack backtrace:
   0:     0x7f9840cf51e1 - std::backtrace_rs::backtrace::libunwind::trace::hd0b11c0adaab3249
                               at /home/matthias/vcs/github/rust_debug_assertions/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7f9840cf51e1 - std::backtrace_rs::backtrace::trace_unsynchronized::h700e400a91d91fde
                               at /home/matthias/vcs/github/rust_debug_assertions/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f9840cf51e1 - std::sys_common::backtrace::_print_fmt::hc78435809ad4efce
                               at /home/matthias/vcs/github/rust_debug_assertions/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x7f9840cf51e1 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::ha735a792fef532f5
                               at /home/matthias/vcs/github/rust_debug_assertions/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7f9840d6bae8 - core::fmt::write::h4891dd9bd07e2ad5

Looks like we print `{stringname}`:\n{message}\n', ....
Might be better to just put everything in one line..?

You might need debug assertion to repro these ICEs in the first place.

Metadata

Metadata

Assignees

Labels

A-diagnosticsArea: Messages for errors, warnings, and lintsA-translationArea: Translation infrastructure, and migrating existing diagnostics to SessionDiagnosticT-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