Skip to content

Improve missing value diagnostics for built-in attributes#159307

Open
TorinAsakura wants to merge 1 commit into
rust-lang:mainfrom
TorinAsakura:fix/builtin-attribute-value-diagnostics
Open

Improve missing value diagnostics for built-in attributes#159307
TorinAsakura wants to merge 1 commit into
rust-lang:mainfrom
TorinAsakura:fix/builtin-attribute-value-diagnostics

Conversation

@TorinAsakura

Copy link
Copy Markdown

Close #86290

When an expression name matches a built-in attribute, late resolution currently reports the attribute as an unexpected value. This keeps the macro fallback for invocable macros but ignores non-macro attributes in expression position, allowing the usual E0425 missing-value diagnostic.

Adds UI coverage for a bare value, a function call, and struct field shorthand.

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jul 14, 2026
@rustbot

rustbot commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the pull request, and welcome! The Rust Project is excited to review your changes, and you should hear from @petrochenkov (or someone else) some time within the next two weeks.

Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (S-waiting-on-review and S-waiting-on-author) stays updated, invoking these commands when appropriate:

  • @rustbot author: the review is finished, PR author should check the comments and take action accordingly
  • @rustbot review: the author is ready for a review, this PR will be queued again in the reviewer's queue
Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 75 candidates
  • Random selection from 21 candidates

@TorinAsakura TorinAsakura force-pushed the fix/builtin-attribute-value-diagnostics branch from 4e36c58 to 92d8373 Compare July 14, 2026 21:29
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-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.

Missing variables/fields give confusing error when name is the same as a built-in attribute like start or path

3 participants