Suggest using comma to separate valid attribute list items#157545
Merged
Conversation
Collaborator
|
Some changes occurred in compiler/rustc_attr_parsing |
Collaborator
|
r? @mejrs rustbot has assigned @mejrs. Use Why was this reviewer chosen?The reviewer was selected based on:
|
Contributor
|
(Would like to take a look at this, should have time tomorrow) |
Contributor
|
(Do we really only have a single test for this?) |
JonathanBrouwer
approved these changes
Jun 7, 2026
Contributor
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Jun 7, 2026
…anBrouwer Suggest using comma to separate valid attribute list items If the parser encounters a missing comma in an attribute arg list and the next item is valid, suggest adding the comma. For example: ``` error: attribute items not separated with `,` --> $DIR/expected-comma-found-token.rs:7:26 | LL | message="the message" | ^ help: try adding `,` here ```
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Jun 7, 2026
…anBrouwer Suggest using comma to separate valid attribute list items If the parser encounters a missing comma in an attribute arg list and the next item is valid, suggest adding the comma. For example: ``` error: attribute items not separated with `,` --> $DIR/expected-comma-found-token.rs:7:26 | LL | message="the message" | ^ help: try adding `,` here ```
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Jun 7, 2026
…anBrouwer Suggest using comma to separate valid attribute list items If the parser encounters a missing comma in an attribute arg list and the next item is valid, suggest adding the comma. For example: ``` error: attribute items not separated with `,` --> $DIR/expected-comma-found-token.rs:7:26 | LL | message="the message" | ^ help: try adding `,` here ```
rust-bors Bot
pushed a commit
that referenced
this pull request
Jun 7, 2026
…uwer Rollup of 10 pull requests Successful merges: - #157447 (Move cross crate tests into the appropriate folder) - #145108 (Resolver: Batched Import Resolution) - #156119 (Further optimize `SliceIndex<str>` impl for `Range<usize>`) - #157289 (Add infallible primitive type lookups to template arg resolver) - #157540 (Cleanup and optimize `render_impls`) - #157543 (Reorganize `tests/ui/issues` [5/N]) - #156188 (riscv: promote d, e, and f target_features to CfgStableToggleUnstable) - #157323 (Document Repeat::last panic behavior) - #157545 (Suggest using comma to separate valid attribute list items) - #157559 (chore: Update annotate-snippets to 0.12.16)
rust-bors Bot
pushed a commit
that referenced
this pull request
Jun 7, 2026
…uwer Rollup of 10 pull requests Successful merges: - #157447 (Move cross crate tests into the appropriate folder) - #145108 (Resolver: Batched Import Resolution) - #156119 (Further optimize `SliceIndex<str>` impl for `Range<usize>`) - #157289 (Add infallible primitive type lookups to template arg resolver) - #157540 (Cleanup and optimize `render_impls`) - #157543 (Reorganize `tests/ui/issues` [5/N]) - #156188 (riscv: promote d, e, and f target_features to CfgStableToggleUnstable) - #157323 (Document Repeat::last panic behavior) - #157545 (Suggest using comma to separate valid attribute list items) - #157559 (chore: Update annotate-snippets to 0.12.16)
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Jun 7, 2026
…anBrouwer Suggest using comma to separate valid attribute list items If the parser encounters a missing comma in an attribute arg list and the next item is valid, suggest adding the comma. For example: ``` error: attribute items not separated with `,` --> $DIR/expected-comma-found-token.rs:7:26 | LL | message="the message" | ^ help: try adding `,` here ```
jhpratt
added a commit
to jhpratt/rust
that referenced
this pull request
Jun 7, 2026
…anBrouwer Suggest using comma to separate valid attribute list items If the parser encounters a missing comma in an attribute arg list and the next item is valid, suggest adding the comma. For example: ``` error: attribute items not separated with `,` --> $DIR/expected-comma-found-token.rs:7:26 | LL | message="the message" | ^ help: try adding `,` here ```
This was referenced Jun 7, 2026
rust-bors Bot
pushed a commit
that referenced
this pull request
Jun 7, 2026
Rollup of 25 pull requests Successful merges: - #157447 (Move cross crate tests into the appropriate folder) - #145108 (Resolver: Batched Import Resolution) - #156119 (Further optimize `SliceIndex<str>` impl for `Range<usize>`) - #157224 (Manually unroll loop in `str::floor_char_boundary`) - #157289 (Add infallible primitive type lookups to template arg resolver) - #157540 (Cleanup and optimize `render_impls`) - #157444 (Couple of work product cleanups) - #157543 (Reorganize `tests/ui/issues` [5/N]) - #153513 (Syntactically reject equality predicates) - #155797 (LineWriter: cap write_vectored newline scan to avoid quadratic write_all_vectored) - #156155 (macros: report unbound metavariables directly) - #156188 (riscv: promote d, e, and f target_features to CfgStableToggleUnstable) - #156666 (Clarify meaning of ranges in pointer offset docs) - #157078 (Document equivalence of `highest_one` and `ilog2` methods on integers) - #157129 (ci: update download-artifact action to v8) - #157169 (triagebot: Update messages to direct changes to appropriate repositories) - #157323 (Document Repeat::last panic behavior) - #157370 (Clarify MaybeUninit::zeroed padding docs) - #157399 (Silence llbc's output by default to prevent rustc's linker output warning) - #157500 (Improve documentation of `align_of` and `Alignment`.) - #157545 (Suggest using comma to separate valid attribute list items) - #157559 (chore: Update annotate-snippets to 0.12.16) - #157560 (In `copy_nonoverlapping`, use `mul nuw nsw` to compute the byte size) - #157580 (Importing suggestion reported twice when reporting privacy error) - #157581 (Test fixup)
rust-bors Bot
pushed a commit
that referenced
this pull request
Jun 7, 2026
Rollup of 25 pull requests Successful merges: - #157447 (Move cross crate tests into the appropriate folder) - #145108 (Resolver: Batched Import Resolution) - #156119 (Further optimize `SliceIndex<str>` impl for `Range<usize>`) - #157224 (Manually unroll loop in `str::floor_char_boundary`) - #157289 (Add infallible primitive type lookups to template arg resolver) - #157540 (Cleanup and optimize `render_impls`) - #157444 (Couple of work product cleanups) - #157543 (Reorganize `tests/ui/issues` [5/N]) - #153513 (Syntactically reject equality predicates) - #155797 (LineWriter: cap write_vectored newline scan to avoid quadratic write_all_vectored) - #156155 (macros: report unbound metavariables directly) - #156188 (riscv: promote d, e, and f target_features to CfgStableToggleUnstable) - #156666 (Clarify meaning of ranges in pointer offset docs) - #157078 (Document equivalence of `highest_one` and `ilog2` methods on integers) - #157129 (ci: update download-artifact action to v8) - #157169 (triagebot: Update messages to direct changes to appropriate repositories) - #157323 (Document Repeat::last panic behavior) - #157370 (Clarify MaybeUninit::zeroed padding docs) - #157399 (Silence llbc's output by default to prevent rustc's linker output warning) - #157500 (Improve documentation of `align_of` and `Alignment`.) - #157545 (Suggest using comma to separate valid attribute list items) - #157559 (chore: Update annotate-snippets to 0.12.16) - #157560 (In `copy_nonoverlapping`, use `mul nuw nsw` to compute the byte size) - #157580 (Importing suggestion reported twice when reporting privacy error) - #157581 (Test fixup)
rust-timer
added a commit
that referenced
this pull request
Jun 8, 2026
Rollup merge of #157545 - ariagivens:suggest-comma, r=JonathanBrouwer Suggest using comma to separate valid attribute list items If the parser encounters a missing comma in an attribute arg list and the next item is valid, suggest adding the comma. For example: ``` error: attribute items not separated with `,` --> $DIR/expected-comma-found-token.rs:7:26 | LL | message="the message" | ^ help: try adding `,` here ```
github-actions Bot
pushed a commit
to rust-lang/stdarch
that referenced
this pull request
Jun 8, 2026
Rollup of 25 pull requests Successful merges: - rust-lang/rust#157447 (Move cross crate tests into the appropriate folder) - rust-lang/rust#145108 (Resolver: Batched Import Resolution) - rust-lang/rust#156119 (Further optimize `SliceIndex<str>` impl for `Range<usize>`) - rust-lang/rust#157224 (Manually unroll loop in `str::floor_char_boundary`) - rust-lang/rust#157289 (Add infallible primitive type lookups to template arg resolver) - rust-lang/rust#157540 (Cleanup and optimize `render_impls`) - rust-lang/rust#157444 (Couple of work product cleanups) - rust-lang/rust#157543 (Reorganize `tests/ui/issues` [5/N]) - rust-lang/rust#153513 (Syntactically reject equality predicates) - rust-lang/rust#155797 (LineWriter: cap write_vectored newline scan to avoid quadratic write_all_vectored) - rust-lang/rust#156155 (macros: report unbound metavariables directly) - rust-lang/rust#156188 (riscv: promote d, e, and f target_features to CfgStableToggleUnstable) - rust-lang/rust#156666 (Clarify meaning of ranges in pointer offset docs) - rust-lang/rust#157078 (Document equivalence of `highest_one` and `ilog2` methods on integers) - rust-lang/rust#157129 (ci: update download-artifact action to v8) - rust-lang/rust#157169 (triagebot: Update messages to direct changes to appropriate repositories) - rust-lang/rust#157323 (Document Repeat::last panic behavior) - rust-lang/rust#157370 (Clarify MaybeUninit::zeroed padding docs) - rust-lang/rust#157399 (Silence llbc's output by default to prevent rustc's linker output warning) - rust-lang/rust#157500 (Improve documentation of `align_of` and `Alignment`.) - rust-lang/rust#157545 (Suggest using comma to separate valid attribute list items) - rust-lang/rust#157559 (chore: Update annotate-snippets to 0.12.16) - rust-lang/rust#157560 (In `copy_nonoverlapping`, use `mul nuw nsw` to compute the byte size) - rust-lang/rust#157580 (Importing suggestion reported twice when reporting privacy error) - rust-lang/rust#157581 (Test fixup)
asukaminato0721
pushed a commit
to asukaminato0721/rust-analyzer
that referenced
this pull request
Jun 8, 2026
Rollup of 25 pull requests Successful merges: - rust-lang/rust#157447 (Move cross crate tests into the appropriate folder) - rust-lang/rust#145108 (Resolver: Batched Import Resolution) - rust-lang/rust#156119 (Further optimize `SliceIndex<str>` impl for `Range<usize>`) - rust-lang/rust#157224 (Manually unroll loop in `str::floor_char_boundary`) - rust-lang/rust#157289 (Add infallible primitive type lookups to template arg resolver) - rust-lang/rust#157540 (Cleanup and optimize `render_impls`) - rust-lang/rust#157444 (Couple of work product cleanups) - rust-lang/rust#157543 (Reorganize `tests/ui/issues` [5/N]) - rust-lang/rust#153513 (Syntactically reject equality predicates) - rust-lang/rust#155797 (LineWriter: cap write_vectored newline scan to avoid quadratic write_all_vectored) - rust-lang/rust#156155 (macros: report unbound metavariables directly) - rust-lang/rust#156188 (riscv: promote d, e, and f target_features to CfgStableToggleUnstable) - rust-lang/rust#156666 (Clarify meaning of ranges in pointer offset docs) - rust-lang/rust#157078 (Document equivalence of `highest_one` and `ilog2` methods on integers) - rust-lang/rust#157129 (ci: update download-artifact action to v8) - rust-lang/rust#157169 (triagebot: Update messages to direct changes to appropriate repositories) - rust-lang/rust#157323 (Document Repeat::last panic behavior) - rust-lang/rust#157370 (Clarify MaybeUninit::zeroed padding docs) - rust-lang/rust#157399 (Silence llbc's output by default to prevent rustc's linker output warning) - rust-lang/rust#157500 (Improve documentation of `align_of` and `Alignment`.) - rust-lang/rust#157545 (Suggest using comma to separate valid attribute list items) - rust-lang/rust#157559 (chore: Update annotate-snippets to 0.12.16) - rust-lang/rust#157560 (In `copy_nonoverlapping`, use `mul nuw nsw` to compute the byte size) - rust-lang/rust#157580 (Importing suggestion reported twice when reporting privacy error) - rust-lang/rust#157581 (Test fixup)
JonathanBrouwer
added a commit
to JonathanBrouwer/rust
that referenced
this pull request
Jun 8, 2026
… r=JonathanBrouwer Suggest comma multiple Following from rust-lang#157545 If there are multiple missing comma's, suggest fixing all of them in one step to avoid error cascade. For example: ``` error: attribute items not separated with `,` | LL | name = "name" | ^ help: try adding `,` here ``` followed by ``` error: attribute items not separated with `,` | LL | kind = "static" | ^ help: try adding `,` here ``` after adding the comma. Now this becomes one error: ``` error: attribute items not separated with `,` --> $DIR/attr-missing-comma.rs:10:18 | LL | name = "name" | ^ | help: try adding `,` here | LL | name = "name", | + help: try adding `,` here | LL | kind = "static", | + ```
rust-timer
added a commit
that referenced
this pull request
Jun 8, 2026
Rollup merge of #157592 - ariagivens:suggest-comma-multiple, r=JonathanBrouwer Suggest comma multiple Following from #157545 If there are multiple missing comma's, suggest fixing all of them in one step to avoid error cascade. For example: ``` error: attribute items not separated with `,` | LL | name = "name" | ^ help: try adding `,` here ``` followed by ``` error: attribute items not separated with `,` | LL | kind = "static" | ^ help: try adding `,` here ``` after adding the comma. Now this becomes one error: ``` error: attribute items not separated with `,` --> $DIR/attr-missing-comma.rs:10:18 | LL | name = "name" | ^ | help: try adding `,` here | LL | name = "name", | + help: try adding `,` here | LL | kind = "static", | + ```
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If the parser encounters a missing comma in an attribute arg list and the next item is valid, suggest adding the comma.
For example: