[tiny] Use multipart suggestion for finding ident when literal was expected in attr#157514
Open
estebank wants to merge 1 commit into
Open
[tiny] Use multipart suggestion for finding ident when literal was expected in attr#157514estebank wants to merge 1 commit into
estebank wants to merge 1 commit into
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:
|
Kivooeo
reviewed
Jun 6, 2026
| // Suggest adding quotation marks to turn an identifier into a string literal | ||
| if let ExprKind::Path(None, ref path) = expr.kind | ||
| && let [segment] = path.segments.as_slice() | ||
| && let [_segment] = path.segments.as_slice() |
Member
There was a problem hiding this comment.
uh, im wondering if [_] would work?
Member
There was a problem hiding this comment.
oh, maybe len better here then?
Contributor
There was a problem hiding this comment.
I think the current code and the two options you suggested are all fine, doesn't really matter
JonathanBrouwer
approved these changes
Jun 6, 2026
1e613b7 to
1ade5a2
Compare
JonathanBrouwer
approved these changes
Jun 13, 2026
Contributor
jhpratt
added a commit
to jhpratt/rust
that referenced
this pull request
Jun 13, 2026
…thanBrouwer [tiny] Use multipart suggestion for finding ident when literal was expected in attr Minor rendering tweak.
rust-bors Bot
pushed a commit
that referenced
this pull request
Jun 13, 2026
Rollup of 9 pull requests Successful merges: - #157653 (remove AliasTerm::def_id()) - #157773 (Remove AnonConstKind::GCA and reject generic anon consts) - #157846 (Avoid ICE in unconstrained generic parameter suggestion for enums) - #157514 ([tiny] Use multipart suggestion for finding ident when literal was expected in attr) - #157740 (rustdoc: correct doctest span for trailing semicolon after item) - #157782 (Added `PhantomPinned` diagnostic item and prevented dead field warning on `PhantomPinned`) - #157802 (Ensure that optimize attributes on closures are inherited by the shim.) - #157812 (rustc_public: implement `ty::Alias` conversion) - #157833 (Update wasm-component-ld to 0.5.25)
Member
Contributor
|
This pull request was unapproved. This PR was contained in a rollup (#157851), which was unapproved. |
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.
Minor rendering tweak.