Suggest adding quotation marks to identifiers in attributes#156797
Conversation
…literal was expected
|
Some changes occurred in compiler/rustc_attr_parsing |
|
r? @Kivooeo rustbot has assigned @Kivooeo. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
Bors u there??? |
…hanBrouwer Suggest adding quotation marks to identifiers in attributes When the user provides an identifier when a literal was expected in an attribute value, suggest adding quotation marks to the identifier to make it a string literal. For instance: ``` error: attribute value must be a literal --> $DIR/crate-type-non-crate.rs:9:16 | LL | #[crate_type = lib] | ^^^ help: try adding quotation marks: `"lib"` ```
…hanBrouwer Suggest adding quotation marks to identifiers in attributes When the user provides an identifier when a literal was expected in an attribute value, suggest adding quotation marks to the identifier to make it a string literal. For instance: ``` error: attribute value must be a literal --> $DIR/crate-type-non-crate.rs:9:16 | LL | #[crate_type = lib] | ^^^ help: try adding quotation marks: `"lib"` ```
|
This pull request was unapproved. This PR was contained in a rollup (#156808), which was unapproved. |
|
I believe this will fix the test issue, but I haven't figured out how to run the apple tests to be sure. |
|
@bors try jobs=aarch64-apple |
This comment has been minimized.
This comment has been minimized.
Suggest adding quotation marks to identifiers in attributes try-job: aarch64-apple
|
💔 Test for 77f4876 failed: CI. Failed job:
|
This comment has been minimized.
This comment has been minimized.
d7be300 to
1fa9548
Compare
|
Okay I have learned the dark secrets of macos emulation. We should be good to go 🙏 @rustbot ready |
|
@bors try jobs=aarch64-apple |
This comment has been minimized.
This comment has been minimized.
Suggest adding quotation marks to identifiers in attributes try-job: aarch64-apple
|
(Also how did you emulate macos? I haven't tried that myself yet, usually just rely on CI) |
I used QEMU and followed the instructions in this repo: https://github.com/kholia/OSX-KVM |
Rollup of 6 pull requests Successful merges: - #156932 (relnotes for 1.96) - #156403 (Add `TypeId` methods `variants` `fields` `field` for `type_info`) - #156797 (Suggest adding quotation marks to identifiers in attributes) - #157014 (Allow building the source tarballs while offline) - #157023 (`#[expect]` is an attribute valid for outer style) - #157025 (Show crate root path in misplaced crate-level attribute diagnostic)
When the user provides an identifier when a literal was expected in an attribute value, suggest adding quotation marks to the identifier to make it a string literal.
For instance: