Skip to content

Preserve explicit register names in inline asm diagnostics - #160068

Open
qaijuang wants to merge 2 commits into
rust-lang:mainfrom
qaijuang:fix-asm-register-alias-diagnostic
Open

Preserve explicit register names in inline asm diagnostics#160068
qaijuang wants to merge 2 commits into
rust-lang:mainfrom
qaijuang:fix-asm-register-alias-diagnostic

Conversation

@qaijuang

@qaijuang qaijuang commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

This PR adds diagnostic-only metadata directly to each register-bearing HIR operand, and replaces #117912 AST lookup with the new HIR metadata.

r? @workingjubilee

Fixes #159409

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jul 28, 2026
@rustbot

rustbot commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

workingjubilee is currently at their maximum review capacity.
They may take a while to respond.

@qaijuang
qaijuang marked this pull request as ready for review July 28, 2026 13:17
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 28, 2026
@rustbot

rustbot commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

clippy is developed in its own repository. If possible, consider making this change to rust-lang/rust-clippy instead.

cc @rust-lang/clippy

@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Jul 28, 2026
@qaijuang
qaijuang force-pushed the fix-asm-register-alias-diagnostic branch from 77c0f58 to d33866e Compare July 28, 2026 13:47

@workingjubilee workingjubilee left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

_ => None,
};
let reg_str = |idx| -> &str {
// HIR asm doesn't preserve the original alias string of the explicit register,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is there a reason it shouldn't, instead of this scheme of re-adding it in metadata?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I don't see or find any reason why it shouldn't

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

asm! xmm16-31 register usage is reported as zmm on i686 targets in diagnostic

3 participants