-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Allow using bool
instead of Option<()>
in diagnostics
#108402
Conversation
r? @TaKO8Ki (rustbot has picked a reviewer for you, use r? to override) |
Some changes occured in cc @BoxyUwU
|
Hm... I actually quite like |
What do you think about reducing this PR to just allowing |
I was mildly annoyed by pub enum ShowAnnotation { Show, Hide } |
I think this is probably a good step to take. I don't have particularly strong feelings about this change. I liked the symmetry between |
This comment was marked as resolved.
This comment was marked as resolved.
4f020a1
to
ef434f0
Compare
bool
instead of Option<()>
in diagnosticsbool
instead of Option<()>
in diagnostics
@bors r+ |
☀️ Test successful - checks-actions |
Finished benchmarking commit (f63ccaf): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
|
Disallow the unit type for#[help]
,#[note]
etc, instead usingbool
to express optional annotations without a span which I believe is more intuitive.Test output ordering has changed in a few places, where a field was of type()
and the annotation has been moved to the struct itself. If any of these changes are an issue, this can be restricted to allowing specifically()
, and notOption<()>
Actual changes here: https://github.com/rust-lang/rust/pull/108402/files#diff-815b1d8debfc564112bd51093791d7c3f2ee288a37a8f5c0e89c11d1f609b4c0Allows using
bool
in derive diagnostics to indicate an optional subdiagnostic without a span, where previouslyOption<()>
had to be used@rustbot label +A-diagnostics