Skip to content

fluent diagnostics can easily overwrite each others' fields/args #142031

Open
@oli-obk

Description

@oli-obk

Currently it is neither an error for diagnostic structs to have fields of the same name as subdiagnostics used in that same struct, nor is it a runtime error to specify arg("foo", ...) twice with the same arg name. This caused some confusion in const eval errors where the main error had an instance field/arg and the stack frame that got printed had an instance per frame

Originally posted by @RalfJung in #142015 (comment)

Metadata

Metadata

Assignees

Labels

A-diagnosticsArea: Messages for errors, warnings, and lintsD-diagnostic-infraDiagnostics: Issues that affect all diagnostics, or relate to the diagnostic machinery itself.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