Skip to content

Commit 732d220

Browse files
Rewrite the new attribute parser
1 parent b13efa6 commit 732d220

File tree

6 files changed

+303
-243
lines changed

6 files changed

+303
-243
lines changed

compiler/rustc_attr_parsing/messages.ftl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,3 +173,10 @@ attr_parsing_invalid_attr_unsafe = `{$name}` is not an unsafe attribute
173173
.label = this is not an unsafe attribute
174174
.suggestion = remove the `unsafe(...)`
175175
.note = extraneous unsafe is not allowed in attributes
176+
177+
attr_parsing_invalid_meta_item = expected a literal (`1u8`, `1.0f32`, `"string"`, etc.) here, found {$descr}
178+
.remove_neg_sugg = negative numbers are not literals, try removing the `-` sign
179+
.quote_ident_sugg = surround the identifier with quotation marks to make it into a string literal
180+
181+
attr_parsing_suffixed_literal_in_attribute = suffixed literals are not allowed in attributes
182+
.help = instead of using a suffixed literal (`1u8`, `1.0f32`, etc.), use an unsuffixed version (`1`, `1.0`, etc.)

0 commit comments

Comments
 (0)