Skip to content

Conversation

@royAmmerschuber
Copy link
Contributor

All the perform_access functions take 5 parameters that are purely used for diagnostic purposes. This puts them all into a single struct and passes them by reference.

@rustbot
Copy link
Collaborator

rustbot commented Dec 4, 2025

Thank you for contributing to Miri! A reviewer will take a look at your PR, typically within a week or two.
Please remember to not force-push to the PR branch except when you need to rebase due to a conflict or when the reviewer asks you for it.

@rustbot rustbot added the S-waiting-on-review Status: Waiting for a review to complete label Dec 4, 2025
Copy link
Member

@RalfJung RalfJung left a 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.

View changes since this review

/// 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 {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why "extra"?

Copy link
Contributor Author

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.

Copy link
Member

@RalfJung RalfJung Dec 5, 2025

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 {
Copy link
Member

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"?

@rustbot

This comment has been minimized.

@royAmmerschuber royAmmerschuber force-pushed the feature/refactor-diagnostics-struct branch from ed383a4 to c7203fb Compare December 8, 2025 11:20
@rustbot

This comment has been minimized.

@rustbot

This comment has been minimized.

Copy link
Member

@RalfJung RalfJung left a 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.

View changes since this review

/// Not set on wildcard accesses.
pub accessed_info: Option<&'node NodeDebugInfo>,
/// Diagnostic data about the current access.
pub access_diagnostics: &'node DiagnosticInfo,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
pub access_diagnostics: &'node DiagnosticInfo,
pub access_info: &'node DiagnosticInfo,

Seems more consistent?

Copy link
Contributor Author

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

Copy link
Member

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?

@royAmmerschuber royAmmerschuber force-pushed the feature/refactor-diagnostics-struct branch from 9f752c4 to 15e9ece Compare December 9, 2025 12:03
@rustbot
Copy link
Collaborator

rustbot commented Dec 9, 2025

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.

@royAmmerschuber royAmmerschuber force-pushed the feature/refactor-diagnostics-struct branch 2 times, most recently from 78cd3e0 to 8d59f87 Compare December 9, 2025 16:33
@RalfJung RalfJung force-pushed the feature/refactor-diagnostics-struct branch from 8d59f87 to b7f7a8f Compare December 9, 2025 22:53
@RalfJung RalfJung enabled auto-merge December 9, 2025 22:53
@RalfJung RalfJung added this pull request to the merge queue Dec 9, 2025
Merged via the queue into rust-lang:master with commit 2b321f2 Dec 9, 2025
13 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Waiting for a review to complete label Dec 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants