-
Notifications
You must be signed in to change notification settings - Fork 417
TreeBorrows: Put accesses diagnostic parameters into a single struct #4740
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
TreeBorrows: Put accesses diagnostic parameters into a single struct #4740
Conversation
|
Thank you for contributing to Miri! A reviewer will take a look at your PR, typically within a week or two. |
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.
Very nice cleanup. :) I just have some nits.
| /// Diagnostics data about the current access and the location we are accessing. | ||
| /// Used to create history events and errors. | ||
| #[derive(Clone, Debug)] | ||
| pub struct DiagnosticsExtra { |
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.
Why "extra"?
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.
Maybe it should be more something like AccessContext? It's just a bunch of metadata about the current access.
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 like to have "Diag(nostics)" in the name as that makes it purpose more clear.
| /// Used to create history events and errors. | ||
| #[derive(Clone, Debug)] | ||
| pub struct DiagnosticsExtra { | ||
| pub struct AccessDiagnostics { |
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 not a big fan of this name -- "diagnostic" is the term used in the Rust compiler for a fully computed warning/error output, and that's not what this is.
What about "DiagnosticInfo"?
This comment has been minimized.
This comment has been minimized.
ed383a4 to
c7203fb
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
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.
LGTM, thanks! Please rebase and squash.
| /// Not set on wildcard accesses. | ||
| pub accessed_info: Option<&'node NodeDebugInfo>, | ||
| /// Diagnostic data about the current access. | ||
| pub access_diagnostics: &'node DiagnosticInfo, |
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.
| pub access_diagnostics: &'node DiagnosticInfo, | |
| pub access_info: &'node DiagnosticInfo, |
Seems more consistent?
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.
accessed_info and access_info seems confusing
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.
Maybe rename accessed_info to accessed_node_info?
9f752c4 to
15e9ece
Compare
|
This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
78cd3e0 to
8d59f87
Compare
8d59f87 to
b7f7a8f
Compare
All the
perform_accessfunctions take 5 parameters that are purely used for diagnostic purposes. This puts them all into a single struct and passes them by reference.