Skip to content

Commit 549314b

Browse files
Rewrite the new attribute parser
1 parent 21d3189 commit 549314b

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
@@ -182,3 +182,10 @@ attr_parsing_invalid_attr_unsafe = `{$name}` is not an unsafe attribute
182182
.label = this is not an unsafe attribute
183183
.suggestion = remove the `unsafe(...)`
184184
.note = extraneous unsafe is not allowed in attributes
185+
186+
attr_parsing_invalid_meta_item = expected a literal (`1u8`, `1.0f32`, `"string"`, etc.) here, found {$descr}
187+
.remove_neg_sugg = negative numbers are not literals, try removing the `-` sign
188+
.quote_ident_sugg = surround the identifier with quotation marks to make it into a string literal
189+
190+
attr_parsing_suffixed_literal_in_attribute = suffixed literals are not allowed in attributes
191+
.help = instead of using a suffixed literal (`1u8`, `1.0f32`, etc.), use an unsuffixed version (`1`, `1.0`, etc.)

0 commit comments

Comments
 (0)