-
Notifications
You must be signed in to change notification settings - Fork 13k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
errors: simplify referring to fluent attributes #97357
errors: simplify referring to fluent attributes #97357
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
0ee959c
to
2ac3740
Compare
|
||
match self { | ||
DiagnosticMessage::Str(s) => DiagnosticMessage::Str(s.clone()), | ||
DiagnosticMessage::FluentIdentifier(id, _) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this ever happen where then _
is Some
already?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It shouldn't as the code is written right now, but it wouldn't be much of a problem if it did. I considered adding a panic or something like that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just a nit and a question, r=me with those resolved/answered
To render the message of a Fluent attribute, the identifier of the Fluent message must be known. `DiagnosticMessage::FluentIdentifier` contains both the message's identifier and optionally the identifier of an attribute. Generated constants for each attribute would therefore need to be named uniquely (amongst all error messages) or be able to refer to only the attribute identifier which will be combined with a message identifier later. In this commit, the latter strategy is implemented as part of the `Diagnostic` type's functions for adding subdiagnostics of various kinds. Signed-off-by: David Wood <david.wood@huawei.com>
2ac3740
to
f669b78
Compare
@bors r=oli-obk |
📌 Commit f669b78 has been approved by |
…ped-subdiagnostic-simplification, r=oli-obk errors: simplify referring to fluent attributes To render the message of a Fluent attribute, the identifier of the Fluent message must be known. `DiagnosticMessage::FluentIdentifier` contains both the message's identifier and optionally the identifier of an attribute. Generated constants for each attribute would therefore need to be named uniquely (amongst all error messages) or be able to refer to only the attribute identifier which will be combined with a message identifier later. In this commit, the latter strategy is implemented as part of the `Diagnostic` type's functions for adding subdiagnostics of various kinds. r? `@oli-obk`
☀️ Test successful - checks-actions |
Finished benchmarking commit (7be9ec2): comparison url. Instruction count
Max RSS (memory usage)Results
CyclesResults
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. Next Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression Footnotes |
visiting for rustc-perf performance triage. There were some regressions here, but they are few, minor, and contained solely to secondary benchmarks (specifically projection-caching and wg-grammar). Marking as triaged. @rustbot label: perf-regression-triaged |
To render the message of a Fluent attribute, the identifier of the Fluent message must be known.
DiagnosticMessage::FluentIdentifier
contains both the message's identifier and optionally the identifier of an attribute. Generated constants for each attribute would therefore need to be named uniquely (amongst all error messages) or be able to refer to only the attribute identifier which will be combined with a message identifier later. In this commit, the latter strategy is implemented as part of theDiagnostic
type's functions for adding subdiagnostics of various kinds.r? @oli-obk