-
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
Avoid double binding of subdiagnostics inside #[derive(SessionDiagnostic)]
#97121
Conversation
subdiagnostic
fields in the second match
inside #[derive(SessionDiagnostic)]
#[derive(SessionDiagnostic)]
this simplifies the code inside the `structure.each` closure argument and allows to remove the `vis` field from `FieldInfo`.
This comment has been minimized.
This comment has been minimized.
@@ -71,55 +71,42 @@ impl<'a> SessionDiagnosticDerive<'a> { | |||
} | |||
}; | |||
|
|||
// Keep track of which fields are subdiagnostics or have no attributes. | |||
let mut subdiagnostics_or_empty = std::collections::HashSet::new(); |
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.
I'm torn on whether or not we should build up a set like this or just do the same check again but negate the result (putting it into a function to avoid duplication obviously). Any thoughts?
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.
I'm under the impression that having the set should be faster than doing the check again but I don't have any hard evidence on it either. I'm happy with both alternatives anyway.
I checked synstructure
to see if we could generate both at the same time to avoid the second filter but it seems that's not the case.
@bors r+ |
📌 Commit 8227e69 has been approved by |
…vidtwco Avoid double binding of subdiagnostics inside `#[derive(SessionDiagnostic)]` r? `@davidtwco`
☀️ Test successful - checks-actions |
Finished benchmarking commit (b2eba05): comparison url. Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)Results
CyclesResults
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. @rustbot label: -perf-regression Footnotes |
r? @davidtwco