1 parse_struct_literal_body_without_path =
2 struct literal body without path
3 .suggestion = you might have forgotten to add the struct literal inside the block
5 parse_struct_literal_needing_parens =
7 .suggestion = you might need to surround the struct literal in parentheses
9 parse_maybe_report_ambiguous_plus =
10 ambiguous `+` in a type
11 .suggestion = use parentheses to disambiguate
13 parse_maybe_recover_from_bad_type_plus =
14 expected a path on the left-hand side of `+`, not `{$ty}`
16 parse_add_paren = try adding parentheses
18 parse_forgot_paren = perhaps you forgot parentheses?
20 parse_expect_path = expected a path
22 parse_maybe_recover_from_bad_qpath_stage_2 =
23 missing angle brackets in associated item path
24 .suggestion = try: `{$ty}`
26 parse_incorrect_semicolon =
27 expected item, found `;`
28 .suggestion = remove this semicolon
29 .help = {$name} declarations are not followed by a semicolon
31 parse_incorrect_use_of_await =
32 incorrect use of `await`
33 .parentheses_suggestion = `await` is not a method call, remove the parentheses
34 .postfix_suggestion = `await` is a postfix operation
37 expected iterable, found keyword `in`
38 .suggestion = remove the duplicated `in`
40 parse_invalid_variable_declaration =
41 invalid variable declaration
43 parse_switch_mut_let_order =
44 switch the order of `mut` and `let`
45 parse_missing_let_before_mut = missing keyword
46 parse_use_let_not_auto = write `let` instead of `auto` to introduce a new variable
47 parse_use_let_not_var = write `let` instead of `var` to introduce a new variable
49 parse_invalid_comparison_operator = invalid comparison operator `{$invalid}`
50 .use_instead = `{$invalid}` is not a valid comparison operator, use `{$correct}`
51 .spaceship_operator_invalid = `<=>` is not a valid comparison operator, use `std::cmp::Ordering`
53 parse_invalid_logical_operator = `{$incorrect}` is not a logical operator
54 .note = unlike in e.g., Python and PHP, `&&` and `||` are used for logical operators
55 .use_amp_amp_for_conjunction = use `&&` to perform logical conjunction
56 .use_pipe_pipe_for_disjunction = use `||` to perform logical disjunction
58 parse_tilde_is_not_unary_operator = `~` cannot be used as a unary operator
59 .suggestion = use `!` to perform bitwise not
61 parse_unexpected_if_with_if = unexpected `if` in the condition expression
62 .suggestion = remove the `if`
64 parse_unexpected_token_after_not = unexpected {$negated_desc} after identifier
65 parse_unexpected_token_after_not_bitwise = use `!` to perform bitwise not
66 parse_unexpected_token_after_not_logical = use `!` to perform logical negation
67 parse_unexpected_token_after_not_default = use `!` to perform logical negation or bitwise not
69 parse_malformed_loop_label = malformed loop label
70 .suggestion = use the correct loop label format
72 parse_lifetime_in_borrow_expression = borrow expressions cannot be annotated with lifetimes
73 .suggestion = remove the lifetime annotation
74 .label = annotated with lifetime here
76 parse_field_expression_with_generic = field expressions cannot have generic arguments
78 parse_macro_invocation_with_qualified_path = macros cannot use qualified paths
80 parse_unexpected_token_after_label = expected `while`, `for`, `loop` or `{"{"}` after a label
81 .suggestion_remove_label = consider removing the label
82 .suggestion_enclose_in_block = consider enclosing expression in a block
84 parse_require_colon_after_labeled_expression = labeled expression must be followed by `:`
85 .note = labels are used before loops and blocks, allowing e.g., `break 'label` to them
87 .suggestion = add `:` after the label
89 parse_do_catch_syntax_removed = found removed `do catch` syntax
90 .note = following RFC #2388, the new non-placeholder syntax is `try`
91 .suggestion = replace with the new syntax
93 parse_float_literal_requires_integer_part = float literals must have an integer part
94 .suggestion = must have an integer part
96 parse_missing_semicolon_before_array = expected `;`, found `[`
97 .suggestion = consider adding `;` here
99 parse_invalid_block_macro_segment = cannot use a `block` macro fragment here
100 .label = the `block` fragment is within this context
102 parse_expect_dotdot_not_dotdotdot = expected `..`, found `...`
103 .suggestion = use `..` to fill in the rest of the fields
105 parse_if_expression_missing_then_block = this `if` expression is missing a block after the condition
106 .add_then_block = add a block here
107 .condition_possibly_unfinished = this binary operation is possibly unfinished
109 parse_if_expression_missing_condition = missing condition for `if` expression
110 .condition_label = expected condition here
111 .block_label = if this block is the condition of the `if` expression, then it must be followed by another block
113 parse_expected_expression_found_let = expected expression, found `let` statement
115 parse_expect_eq_instead_of_eqeq = expected `=`, found `==`
116 .suggestion = consider using `=` here
118 parse_expected_else_block = expected `{"{"}`, found {$first_tok}
119 .label = expected an `if` or a block after this `else`
120 .suggestion = add an `if` if this is the condition of a chained `else if` statement
122 parse_outer_attribute_not_allowed_on_if_else = outer attributes are not allowed on `if` and `else` branches
123 .branch_label = the attributes are attached to this branch
124 .ctx_label = the branch belongs to this `{$ctx}`
125 .suggestion = remove the attributes
127 parse_missing_in_in_for_loop = missing `in` in `for` loop
128 .use_in_not_of = try using `in` here instead
129 .add_in = try adding `in` here
131 parse_missing_comma_after_match_arm = expected `,` following `match` arm
132 .suggestion = missing a comma here to end this `match` arm
134 parse_catch_after_try = keyword `catch` cannot follow a `try` block
135 .help = try using `match` on the result of the `try` block instead
137 parse_comma_after_base_struct = cannot use a comma after the base struct
138 .note = the base struct must always be the last field
139 .suggestion = remove this comma
141 parse_eq_field_init = expected `:`, found `=`
142 .suggestion = replace equals symbol with a colon
144 parse_dotdotdot = unexpected token: `...`
145 .suggest_exclusive_range = use `..` for an exclusive range
146 .suggest_inclusive_range = or `..=` for an inclusive range
148 parse_left_arrow_operator = unexpected token: `<-`
149 .suggestion = if you meant to write a comparison against a negative value, add a space in between `<` and `-`
151 parse_remove_let = expected pattern, found `let`
152 .suggestion = remove the unnecessary `let` keyword
154 parse_use_eq_instead = unexpected `==`
155 .suggestion = try using `=` instead
157 parse_use_empty_block_not_semi = expected { "`{}`" }, found `;`
158 .suggestion = try using { "`{}`" } instead
160 parse_comparison_interpreted_as_generic =
161 `<` is interpreted as a start of generic arguments for `{$type}`, not a comparison
162 .label_args = interpreted as generic arguments
163 .label_comparison = not interpreted as comparison
164 .suggestion = try comparing the cast value
166 parse_shift_interpreted_as_generic =
167 `<<` is interpreted as a start of generic arguments for `{$type}`, not a shift
168 .label_args = interpreted as generic arguments
169 .label_comparison = not interpreted as shift
170 .suggestion = try shifting the cast value
172 parse_found_expr_would_be_stmt = expected expression, found `{$token}`
173 .label = expected expression
175 parse_leading_plus_not_supported = leading `+` is not supported
176 .label = unexpected `+`
177 .suggestion_remove_plus = try removing the `+`
179 parse_parentheses_with_struct_fields = invalid `struct` delimiters or `fn` call arguments
180 .suggestion_braces_for_struct = if `{$type}` is a struct, use braces as delimiters
181 .suggestion_no_fields_for_fn = if `{$type}` is a function, use the arguments directly
183 parse_labeled_loop_in_break = parentheses are required around this expression to avoid confusion with a labeled break expression
185 parse_sugg_wrap_expression_in_parentheses = wrap the expression in parentheses
187 parse_array_brackets_instead_of_braces = this is a block expression, not an array
188 .suggestion = to make an array, use square brackets instead of curly braces
190 parse_match_arm_body_without_braces = `match` arm body without braces
191 .label_statements = {$num_statements ->
192 [one] this statement is not surrounded by a body
193 *[other] these statements are not surrounded by a body
195 .label_arrow = while parsing the `match` arm starting here
196 .suggestion_add_braces = surround the {$num_statements ->
200 .suggestion_use_comma_not_semicolon = use a comma to end a `match` arm expression
202 parse_struct_literal_not_allowed_here = struct literals are not allowed here
203 .suggestion = surround the struct literal with parentheses
205 parse_invalid_interpolated_expression = invalid interpolated expression
207 parse_invalid_literal_suffix_on_tuple_index = suffixes on a tuple index are invalid
208 .label = invalid suffix `{$suffix}`
209 .tuple_exception_line_1 = `{$suffix}` is *temporarily* accepted on tuple index fields as it was incorrectly accepted on stable for a few releases
210 .tuple_exception_line_2 = on proc macros, you'll want to use `syn::Index::from` or `proc_macro::Literal::*_unsuffixed` for code that will desugar to tuple field access
211 .tuple_exception_line_3 = see issue #60210 <https://github.com/rust-lang/rust/issues/60210> for more information
213 parse_non_string_abi_literal = non-string ABI literal
214 .suggestion = specify the ABI with a string literal
216 parse_mismatched_closing_delimiter = mismatched closing delimiter: `{$delimiter}`
217 .label_unmatched = mismatched closing delimiter
218 .label_opening_candidate = closing delimiter possibly meant for this
219 .label_unclosed = unclosed delimiter
221 parse_incorrect_visibility_restriction = incorrect visibility restriction
222 .help = some possible visibility restrictions are:
223 `pub(crate)`: visible only on the current crate
224 `pub(super)`: visible only in the current module's parent
225 `pub(in path::to::module)`: visible only on the specified path
226 .suggestion = make this visible only to module `{$inner_str}` with `in`
228 parse_assignment_else_not_allowed = <assignment> ... else {"{"} ... {"}"} is not allowed
230 parse_expected_statement_after_outer_attr = expected statement after outer attribute
232 parse_doc_comment_does_not_document_anything = found a documentation comment that doesn't document anything
233 .help = doc comments must come before what they document, if a comment was intended use `//`
234 .suggestion = missing comma here
236 parse_const_let_mutually_exclusive = `const` and `let` are mutually exclusive
237 .suggestion = remove `let`
239 parse_invalid_expression_in_let_else = a `{$operator}` expression cannot be directly assigned in `let...else`
240 parse_invalid_curly_in_let_else = right curly brace `{"}"}` before `else` in a `let...else` statement not allowed
241 parse_extra_if_in_let_else = remove the `if` if you meant to write a `let...else` statement
243 parse_compound_assignment_expression_in_let = can't reassign to an uninitialized variable
244 .suggestion = initialize the variable
245 .help = if you meant to overwrite, remove the `let` binding
247 parse_suffixed_literal_in_attribute = suffixed literals are not allowed in attributes
248 .help = instead of using a suffixed literal (`1u8`, `1.0f32`, etc.), use an unsuffixed version (`1`, `1.0`, etc.)
250 parse_invalid_meta_item = expected unsuffixed literal or identifier, found `{$token}`
252 parse_label_inner_attr_does_not_annotate_this = the inner attribute doesn't annotate this {$item}
253 parse_sugg_change_inner_attr_to_outer = to annotate the {$item}, change the attribute from inner to outer style
255 parse_inner_attr_not_permitted_after_outer_doc_comment = an inner attribute is not permitted following an outer doc comment
256 .label_attr = not permitted following an outer doc comment
257 .label_prev_doc_comment = previous doc comment
258 .label_does_not_annotate_this = {parse_label_inner_attr_does_not_annotate_this}
259 .sugg_change_inner_to_outer = {parse_sugg_change_inner_attr_to_outer}
261 parse_inner_attr_not_permitted_after_outer_attr = an inner attribute is not permitted following an outer attribute
262 .label_attr = not permitted following an outer attribute
263 .label_prev_attr = previous outer attribute
264 .label_does_not_annotate_this = {parse_label_inner_attr_does_not_annotate_this}
265 .sugg_change_inner_to_outer = {parse_sugg_change_inner_attr_to_outer}
267 parse_inner_attr_not_permitted = an inner attribute is not permitted in this context
268 .label_does_not_annotate_this = {parse_label_inner_attr_does_not_annotate_this}
269 .sugg_change_inner_to_outer = {parse_sugg_change_inner_attr_to_outer}
271 parse_inner_attr_explanation = inner attributes, like `#![no_std]`, annotate the item enclosing them, and are usually found at the beginning of source files
272 parse_outer_attr_explanation = outer attributes, like `#[test]`, annotate the item following them
274 parse_inner_doc_comment_not_permitted = expected outer doc comment
275 .note = inner doc comments like this (starting with `//!` or `/*!`) can only appear before items
276 .suggestion = you might have meant to write a regular comment
277 .label_does_not_annotate_this = the inner doc comment doesn't annotate this {$item}
278 .sugg_change_inner_to_outer = to annotate the {$item}, change the doc comment from inner to outer style
280 parse_expected_identifier_found_reserved_identifier_str = expected identifier, found reserved identifier `{$token}`
281 parse_expected_identifier_found_keyword_str = expected identifier, found keyword `{$token}`
282 parse_expected_identifier_found_reserved_keyword_str = expected identifier, found reserved keyword `{$token}`
283 parse_expected_identifier_found_doc_comment_str = expected identifier, found doc comment `{$token}`
284 parse_expected_identifier_found_str = expected identifier, found `{$token}`
286 parse_expected_identifier_found_reserved_identifier = expected identifier, found reserved identifier
287 parse_expected_identifier_found_keyword = expected identifier, found keyword
288 parse_expected_identifier_found_reserved_keyword = expected identifier, found reserved keyword
289 parse_expected_identifier_found_doc_comment = expected identifier, found doc comment
290 parse_expected_identifier = expected identifier
292 parse_sugg_escape_to_use_as_identifier = escape `{$ident_name}` to use it as an identifier
294 parse_sugg_remove_comma = remove this comma
296 parse_expected_semi_found_reserved_identifier_str = expected `;`, found reserved identifier `{$token}`
297 parse_expected_semi_found_keyword_str = expected `;`, found keyword `{$token}`
298 parse_expected_semi_found_reserved_keyword_str = expected `;`, found reserved keyword `{$token}`
299 parse_expected_semi_found_doc_comment_str = expected `;`, found doc comment `{$token}`
300 parse_expected_semi_found_str = expected `;`, found `{$token}`
302 parse_sugg_change_this_to_semi = change this to `;`
303 parse_sugg_add_semi = add `;` here
304 parse_label_unexpected_token = unexpected token
306 parse_unmatched_angle_brackets = {$num_extra_brackets ->
307 [one] unmatched angle bracket
308 *[other] unmatched angle brackets
310 .suggestion = {$num_extra_brackets ->
311 [one] remove extra angle bracket
312 *[other] remove extra angle brackets
315 parse_generic_parameters_without_angle_brackets = generic parameters without surrounding angle brackets
316 .suggestion = surround the type parameters with angle brackets
318 parse_comparison_operators_cannot_be_chained = comparison operators cannot be chained
319 .sugg_parentheses_for_function_args = or use `(...)` if you meant to specify fn arguments
320 .sugg_split_comparison = split the comparison into two
321 .sugg_parenthesize = parenthesize the comparison
322 parse_sugg_turbofish_syntax = use `::<...>` instead of `<...>` to specify lifetime, type, or const arguments
324 parse_question_mark_in_type = invalid `?` in type
325 .label = `?` is only allowed on expressions, not types
326 .suggestion = if you meant to express that the type might not contain a value, use the `Option` wrapper type
328 parse_unexpected_parentheses_in_for_head = unexpected parentheses surrounding `for` loop head
329 .suggestion = remove parentheses in `for` loop
331 parse_doc_comment_on_param_type = documentation comments cannot be applied to a function parameter's type
332 .label = doc comments are not allowed here
334 parse_attribute_on_param_type = attributes cannot be applied to a function parameter's type
335 .label = attributes are not allowed here
337 parse_pattern_method_param_without_body = patterns aren't allowed in methods without bodies
338 .suggestion = give this argument a name or use an underscore to ignore it
340 parse_self_param_not_first = unexpected `self` parameter in function
341 .label = must be the first parameter of an associated function
343 parse_const_generic_without_braces = expressions must be enclosed in braces to be used as const generic arguments
344 .suggestion = enclose the `const` expression in braces
346 parse_unexpected_const_param_declaration = unexpected `const` parameter declaration
347 .label = expected a `const` expression, not a parameter declaration
348 .suggestion = `const` parameters must be declared for the `impl`
350 parse_unexpected_const_in_generic_param = expected lifetime, type, or constant, found keyword `const`
351 .suggestion = the `const` keyword is only needed in the definition of the type
353 parse_async_move_order_incorrect = the order of `move` and `async` is incorrect
354 .suggestion = try switching the order
356 parse_double_colon_in_bound = expected `:` followed by trait or lifetime
357 .suggestion = use single colon
359 parse_fn_ptr_with_generics = function pointer types may not have generic parameters
360 .suggestion = consider moving the lifetime {$arity ->
363 } to {$for_param_list_exists ->
366 } `for` parameter list
368 parse_invalid_identifier_with_leading_number = expected identifier, found number literal
369 .label = identifiers cannot start with a number
371 parse_maybe_fn_typo_with_impl = you might have meant to write `impl` instead of `fn`
372 .suggestion = replace `fn` with `impl` here
374 parse_expected_fn_path_found_fn_keyword = expected identifier, found keyword `fn`
375 .suggestion = use `Fn` to refer to the trait
377 parse_where_clause_before_tuple_struct_body = where clauses are not allowed before tuple struct bodies
378 .label = unexpected where clause
379 .name_label = while parsing this tuple struct
380 .body_label = the struct body
381 .suggestion = move the body before the where clause