Skip to content

distinguish "expected a single argument" and "expected an argument" on attribute parsing#154827

Open
scrabsha wants to merge 4 commits intorust-lang:mainfrom
scrabsha:push-zuosxmmnzkrq
Open

distinguish "expected a single argument" and "expected an argument" on attribute parsing#154827
scrabsha wants to merge 4 commits intorust-lang:mainfrom
scrabsha:push-zuosxmmnzkrq

Conversation

@scrabsha
Copy link
Copy Markdown
Contributor

@scrabsha scrabsha commented Apr 4, 2026

First commit is the real thing, the commits that follow are refactorings of patterns i kept noticing.

Renders as:
error message

@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Apr 4, 2026
@scrabsha scrabsha force-pushed the push-zuosxmmnzkrq branch 2 times, most recently from 2b3f438 to 436a3bb Compare April 4, 2026 20:07
@rust-log-analyzer

This comment has been minimized.

@scrabsha scrabsha force-pushed the push-zuosxmmnzkrq branch 2 times, most recently from b99582a to 61551e5 Compare April 5, 2026 12:18
@rust-log-analyzer

This comment has been minimized.

@scrabsha scrabsha force-pushed the push-zuosxmmnzkrq branch from 61551e5 to c76706b Compare April 6, 2026 09:32
@rust-log-analyzer

This comment has been minimized.

@scrabsha scrabsha force-pushed the push-zuosxmmnzkrq branch 3 times, most recently from 8fdfe78 to cd2de6a Compare April 6, 2026 10:14
let Some(arg) = args.list().and_then(MetaItemListParser::single) else {
let attr_span = cx.attr_span;
cx.adcx().expected_single_argument(attr_span);
cx.adcx().expected_single_argument(attr_span, 2);
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.

This is technically incorrect, but fixed two commits later.

@scrabsha scrabsha force-pushed the push-zuosxmmnzkrq branch from cd2de6a to 9173a9b Compare April 6, 2026 10:30
@rust-log-analyzer

This comment has been minimized.

@scrabsha scrabsha force-pushed the push-zuosxmmnzkrq branch from 9173a9b to 1d395f3 Compare April 6, 2026 13:16
@rust-bors

This comment has been minimized.

@scrabsha scrabsha force-pushed the push-zuosxmmnzkrq branch from 1d395f3 to ec3f438 Compare April 9, 2026 17:11
@scrabsha
Copy link
Copy Markdown
Contributor Author

scrabsha commented Apr 9, 2026

r? @jdonszelmann

@scrabsha scrabsha marked this pull request as ready for review April 9, 2026 21:10
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 9, 2026

Some changes occurred in compiler/rustc_attr_parsing

cc @jdonszelmann, @JonathanBrouwer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Apr 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) 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.

4 participants