]>
Commit | Line | Data |
---|---|---|
487cf647 FG |
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 | |
4 | ||
9c376795 FG |
5 | parse_struct_literal_needing_parens = |
6 | invalid struct literal | |
7 | .suggestion = you might need to surround the struct literal in parentheses | |
8 | ||
487cf647 FG |
9 | parse_maybe_report_ambiguous_plus = |
10 | ambiguous `+` in a type | |
11 | .suggestion = use parentheses to disambiguate | |
12 | ||
13 | parse_maybe_recover_from_bad_type_plus = | |
14 | expected a path on the left-hand side of `+`, not `{$ty}` | |
15 | ||
16 | parse_add_paren = try adding parentheses | |
17 | ||
18 | parse_forgot_paren = perhaps you forgot parentheses? | |
19 | ||
20 | parse_expect_path = expected a path | |
21 | ||
22 | parse_maybe_recover_from_bad_qpath_stage_2 = | |
23 | missing angle brackets in associated item path | |
24 | .suggestion = try: `{$ty}` | |
25 | ||
26 | parse_incorrect_semicolon = | |
27 | expected item, found `;` | |
28 | .suggestion = remove this semicolon | |
29 | .help = {$name} declarations are not followed by a semicolon | |
30 | ||
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 | |
35 | ||
36 | parse_in_in_typo = | |
37 | expected iterable, found keyword `in` | |
38 | .suggestion = remove the duplicated `in` | |
39 | ||
40 | parse_invalid_variable_declaration = | |
41 | invalid variable declaration | |
42 | ||
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 | |
48 | ||
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` | |
52 | ||
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 | |
57 | ||
58 | parse_tilde_is_not_unary_operator = `~` cannot be used as a unary operator | |
59 | .suggestion = use `!` to perform bitwise not | |
60 | ||
61 | parse_unexpected_if_with_if = unexpected `if` in the condition expression | |
62 | .suggestion = remove the `if` | |
63 | ||
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 | |
68 | ||
69 | parse_malformed_loop_label = malformed loop label | |
70 | .suggestion = use the correct loop label format | |
71 | ||
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 | |
75 | ||
76 | parse_field_expression_with_generic = field expressions cannot have generic arguments | |
77 | ||
78 | parse_macro_invocation_with_qualified_path = macros cannot use qualified paths | |
79 | ||
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 | |
83 | ||
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 | |
86 | .label = the label | |
87 | .suggestion = add `:` after the label | |
88 | ||
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 | |
92 | ||
93 | parse_float_literal_requires_integer_part = float literals must have an integer part | |
94 | .suggestion = must have an integer part | |
95 | ||
9ffffee4 FG |
96 | parse_invalid_int_literal_width = invalid width `{$width}` for integer literal |
97 | .help = valid widths are 8, 16, 32, 64 and 128 | |
98 | ||
99 | parse_invalid_num_literal_base_prefix = invalid base prefix for number literal | |
100 | .note = base prefixes (`0xff`, `0b1010`, `0o755`) are lowercase | |
101 | .suggestion = try making the prefix lowercase | |
102 | ||
103 | parse_invalid_num_literal_suffix = invalid suffix `{$suffix}` for number literal | |
104 | .label = invalid suffix `{$suffix}` | |
105 | .help = the suffix must be one of the numeric types (`u32`, `isize`, `f32`, etc.) | |
106 | ||
107 | parse_invalid_float_literal_width = invalid width `{$width}` for float literal | |
108 | .help = valid widths are 32 and 64 | |
109 | ||
110 | parse_invalid_float_literal_suffix = invalid suffix `{$suffix}` for float literal | |
111 | .label = invalid suffix `{$suffix}` | |
112 | .help = valid suffixes are `f32` and `f64` | |
113 | ||
114 | parse_int_literal_too_large = integer literal is too large | |
115 | ||
487cf647 FG |
116 | parse_missing_semicolon_before_array = expected `;`, found `[` |
117 | .suggestion = consider adding `;` here | |
118 | ||
119 | parse_invalid_block_macro_segment = cannot use a `block` macro fragment here | |
120 | .label = the `block` fragment is within this context | |
121 | ||
122 | parse_expect_dotdot_not_dotdotdot = expected `..`, found `...` | |
123 | .suggestion = use `..` to fill in the rest of the fields | |
124 | ||
125 | parse_if_expression_missing_then_block = this `if` expression is missing a block after the condition | |
126 | .add_then_block = add a block here | |
127 | .condition_possibly_unfinished = this binary operation is possibly unfinished | |
128 | ||
129 | parse_if_expression_missing_condition = missing condition for `if` expression | |
130 | .condition_label = expected condition here | |
131 | .block_label = if this block is the condition of the `if` expression, then it must be followed by another block | |
132 | ||
133 | parse_expected_expression_found_let = expected expression, found `let` statement | |
134 | ||
135 | parse_expect_eq_instead_of_eqeq = expected `=`, found `==` | |
136 | .suggestion = consider using `=` here | |
137 | ||
138 | parse_expected_else_block = expected `{"{"}`, found {$first_tok} | |
139 | .label = expected an `if` or a block after this `else` | |
140 | .suggestion = add an `if` if this is the condition of a chained `else if` statement | |
141 | ||
142 | parse_outer_attribute_not_allowed_on_if_else = outer attributes are not allowed on `if` and `else` branches | |
143 | .branch_label = the attributes are attached to this branch | |
144 | .ctx_label = the branch belongs to this `{$ctx}` | |
145 | .suggestion = remove the attributes | |
146 | ||
147 | parse_missing_in_in_for_loop = missing `in` in `for` loop | |
148 | .use_in_not_of = try using `in` here instead | |
149 | .add_in = try adding `in` here | |
150 | ||
9ffffee4 FG |
151 | parse_missing_expression_in_for_loop = missing expression to iterate on in `for` loop |
152 | .suggestion = try adding an expression to the `for` loop | |
153 | ||
154 | parse_loop_else = `{$loop_kind}...else` loops are not supported | |
155 | .note = consider moving this `else` clause to a separate `if` statement and use a `bool` variable to control if it should run | |
156 | .loop_keyword = `else` is attached to this loop | |
157 | ||
487cf647 FG |
158 | parse_missing_comma_after_match_arm = expected `,` following `match` arm |
159 | .suggestion = missing a comma here to end this `match` arm | |
160 | ||
161 | parse_catch_after_try = keyword `catch` cannot follow a `try` block | |
162 | .help = try using `match` on the result of the `try` block instead | |
163 | ||
164 | parse_comma_after_base_struct = cannot use a comma after the base struct | |
165 | .note = the base struct must always be the last field | |
166 | .suggestion = remove this comma | |
167 | ||
168 | parse_eq_field_init = expected `:`, found `=` | |
169 | .suggestion = replace equals symbol with a colon | |
170 | ||
171 | parse_dotdotdot = unexpected token: `...` | |
172 | .suggest_exclusive_range = use `..` for an exclusive range | |
173 | .suggest_inclusive_range = or `..=` for an inclusive range | |
174 | ||
175 | parse_left_arrow_operator = unexpected token: `<-` | |
176 | .suggestion = if you meant to write a comparison against a negative value, add a space in between `<` and `-` | |
177 | ||
178 | parse_remove_let = expected pattern, found `let` | |
179 | .suggestion = remove the unnecessary `let` keyword | |
180 | ||
181 | parse_use_eq_instead = unexpected `==` | |
182 | .suggestion = try using `=` instead | |
183 | ||
184 | parse_use_empty_block_not_semi = expected { "`{}`" }, found `;` | |
185 | .suggestion = try using { "`{}`" } instead | |
186 | ||
187 | parse_comparison_interpreted_as_generic = | |
188 | `<` is interpreted as a start of generic arguments for `{$type}`, not a comparison | |
189 | .label_args = interpreted as generic arguments | |
190 | .label_comparison = not interpreted as comparison | |
191 | .suggestion = try comparing the cast value | |
192 | ||
193 | parse_shift_interpreted_as_generic = | |
194 | `<<` is interpreted as a start of generic arguments for `{$type}`, not a shift | |
195 | .label_args = interpreted as generic arguments | |
196 | .label_comparison = not interpreted as shift | |
197 | .suggestion = try shifting the cast value | |
198 | ||
199 | parse_found_expr_would_be_stmt = expected expression, found `{$token}` | |
200 | .label = expected expression | |
201 | ||
202 | parse_leading_plus_not_supported = leading `+` is not supported | |
203 | .label = unexpected `+` | |
204 | .suggestion_remove_plus = try removing the `+` | |
205 | ||
206 | parse_parentheses_with_struct_fields = invalid `struct` delimiters or `fn` call arguments | |
207 | .suggestion_braces_for_struct = if `{$type}` is a struct, use braces as delimiters | |
208 | .suggestion_no_fields_for_fn = if `{$type}` is a function, use the arguments directly | |
209 | ||
210 | parse_labeled_loop_in_break = parentheses are required around this expression to avoid confusion with a labeled break expression | |
211 | ||
212 | parse_sugg_wrap_expression_in_parentheses = wrap the expression in parentheses | |
213 | ||
214 | parse_array_brackets_instead_of_braces = this is a block expression, not an array | |
215 | .suggestion = to make an array, use square brackets instead of curly braces | |
216 | ||
217 | parse_match_arm_body_without_braces = `match` arm body without braces | |
218 | .label_statements = {$num_statements -> | |
219 | [one] this statement is not surrounded by a body | |
220 | *[other] these statements are not surrounded by a body | |
221 | } | |
222 | .label_arrow = while parsing the `match` arm starting here | |
223 | .suggestion_add_braces = surround the {$num_statements -> | |
224 | [one] statement | |
225 | *[other] statements | |
226 | } with a body | |
9ffffee4 FG |
227 | .suggestion_use_comma_not_semicolon = replace `;` with `,` to end a `match` arm expression |
228 | ||
229 | parse_inclusive_range_extra_equals = unexpected `=` after inclusive range | |
230 | .suggestion_remove_eq = use `..=` instead | |
231 | .note = inclusive ranges end with a single equals sign (`..=`) | |
232 | ||
233 | parse_inclusive_range_match_arrow = unexpected `>` after inclusive range | |
234 | .label = this is parsed as an inclusive range `..=` | |
235 | .suggestion = add a space between the pattern and `=>` | |
236 | ||
237 | parse_inclusive_range_no_end = inclusive range with no end | |
238 | .suggestion_open_range = use `..` instead | |
239 | .note = inclusive ranges must be bounded at the end (`..=b` or `a..=b`) | |
487cf647 FG |
240 | |
241 | parse_struct_literal_not_allowed_here = struct literals are not allowed here | |
242 | .suggestion = surround the struct literal with parentheses | |
243 | ||
244 | parse_invalid_interpolated_expression = invalid interpolated expression | |
245 | ||
9ffffee4 FG |
246 | parse_hexadecimal_float_literal_not_supported = hexadecimal float literal is not supported |
247 | parse_octal_float_literal_not_supported = octal float literal is not supported | |
248 | parse_binary_float_literal_not_supported = binary float literal is not supported | |
249 | parse_not_supported = not supported | |
250 | ||
251 | parse_invalid_literal_suffix = suffixes on {$kind} literals are invalid | |
252 | .label = invalid suffix `{$suffix}` | |
253 | ||
487cf647 FG |
254 | parse_invalid_literal_suffix_on_tuple_index = suffixes on a tuple index are invalid |
255 | .label = invalid suffix `{$suffix}` | |
256 | .tuple_exception_line_1 = `{$suffix}` is *temporarily* accepted on tuple index fields as it was incorrectly accepted on stable for a few releases | |
257 | .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 | |
258 | .tuple_exception_line_3 = see issue #60210 <https://github.com/rust-lang/rust/issues/60210> for more information | |
259 | ||
260 | parse_non_string_abi_literal = non-string ABI literal | |
261 | .suggestion = specify the ABI with a string literal | |
262 | ||
263 | parse_mismatched_closing_delimiter = mismatched closing delimiter: `{$delimiter}` | |
264 | .label_unmatched = mismatched closing delimiter | |
265 | .label_opening_candidate = closing delimiter possibly meant for this | |
266 | .label_unclosed = unclosed delimiter | |
267 | ||
268 | parse_incorrect_visibility_restriction = incorrect visibility restriction | |
269 | .help = some possible visibility restrictions are: | |
270 | `pub(crate)`: visible only on the current crate | |
271 | `pub(super)`: visible only in the current module's parent | |
272 | `pub(in path::to::module)`: visible only on the specified path | |
273 | .suggestion = make this visible only to module `{$inner_str}` with `in` | |
274 | ||
275 | parse_assignment_else_not_allowed = <assignment> ... else {"{"} ... {"}"} is not allowed | |
276 | ||
277 | parse_expected_statement_after_outer_attr = expected statement after outer attribute | |
278 | ||
279 | parse_doc_comment_does_not_document_anything = found a documentation comment that doesn't document anything | |
280 | .help = doc comments must come before what they document, if a comment was intended use `//` | |
281 | .suggestion = missing comma here | |
282 | ||
283 | parse_const_let_mutually_exclusive = `const` and `let` are mutually exclusive | |
284 | .suggestion = remove `let` | |
285 | ||
286 | parse_invalid_expression_in_let_else = a `{$operator}` expression cannot be directly assigned in `let...else` | |
287 | parse_invalid_curly_in_let_else = right curly brace `{"}"}` before `else` in a `let...else` statement not allowed | |
9ffffee4 | 288 | parse_extra_if_in_let_else = remove the `if` if you meant to write a `let...else` statement |
487cf647 FG |
289 | |
290 | parse_compound_assignment_expression_in_let = can't reassign to an uninitialized variable | |
291 | .suggestion = initialize the variable | |
292 | .help = if you meant to overwrite, remove the `let` binding | |
293 | ||
294 | parse_suffixed_literal_in_attribute = suffixed literals are not allowed in attributes | |
295 | .help = instead of using a suffixed literal (`1u8`, `1.0f32`, etc.), use an unsuffixed version (`1`, `1.0`, etc.) | |
296 | ||
297 | parse_invalid_meta_item = expected unsuffixed literal or identifier, found `{$token}` | |
298 | ||
299 | parse_label_inner_attr_does_not_annotate_this = the inner attribute doesn't annotate this {$item} | |
300 | parse_sugg_change_inner_attr_to_outer = to annotate the {$item}, change the attribute from inner to outer style | |
301 | ||
302 | parse_inner_attr_not_permitted_after_outer_doc_comment = an inner attribute is not permitted following an outer doc comment | |
303 | .label_attr = not permitted following an outer doc comment | |
304 | .label_prev_doc_comment = previous doc comment | |
305 | .label_does_not_annotate_this = {parse_label_inner_attr_does_not_annotate_this} | |
306 | .sugg_change_inner_to_outer = {parse_sugg_change_inner_attr_to_outer} | |
307 | ||
308 | parse_inner_attr_not_permitted_after_outer_attr = an inner attribute is not permitted following an outer attribute | |
309 | .label_attr = not permitted following an outer attribute | |
310 | .label_prev_attr = previous outer attribute | |
311 | .label_does_not_annotate_this = {parse_label_inner_attr_does_not_annotate_this} | |
312 | .sugg_change_inner_to_outer = {parse_sugg_change_inner_attr_to_outer} | |
313 | ||
314 | parse_inner_attr_not_permitted = an inner attribute is not permitted in this context | |
315 | .label_does_not_annotate_this = {parse_label_inner_attr_does_not_annotate_this} | |
316 | .sugg_change_inner_to_outer = {parse_sugg_change_inner_attr_to_outer} | |
317 | ||
318 | parse_inner_attr_explanation = inner attributes, like `#![no_std]`, annotate the item enclosing them, and are usually found at the beginning of source files | |
319 | parse_outer_attr_explanation = outer attributes, like `#[test]`, annotate the item following them | |
320 | ||
321 | parse_inner_doc_comment_not_permitted = expected outer doc comment | |
322 | .note = inner doc comments like this (starting with `//!` or `/*!`) can only appear before items | |
323 | .suggestion = you might have meant to write a regular comment | |
324 | .label_does_not_annotate_this = the inner doc comment doesn't annotate this {$item} | |
325 | .sugg_change_inner_to_outer = to annotate the {$item}, change the doc comment from inner to outer style | |
326 | ||
327 | parse_expected_identifier_found_reserved_identifier_str = expected identifier, found reserved identifier `{$token}` | |
328 | parse_expected_identifier_found_keyword_str = expected identifier, found keyword `{$token}` | |
329 | parse_expected_identifier_found_reserved_keyword_str = expected identifier, found reserved keyword `{$token}` | |
330 | parse_expected_identifier_found_doc_comment_str = expected identifier, found doc comment `{$token}` | |
331 | parse_expected_identifier_found_str = expected identifier, found `{$token}` | |
332 | ||
333 | parse_expected_identifier_found_reserved_identifier = expected identifier, found reserved identifier | |
334 | parse_expected_identifier_found_keyword = expected identifier, found keyword | |
335 | parse_expected_identifier_found_reserved_keyword = expected identifier, found reserved keyword | |
336 | parse_expected_identifier_found_doc_comment = expected identifier, found doc comment | |
337 | parse_expected_identifier = expected identifier | |
338 | ||
339 | parse_sugg_escape_to_use_as_identifier = escape `{$ident_name}` to use it as an identifier | |
340 | ||
341 | parse_sugg_remove_comma = remove this comma | |
342 | ||
343 | parse_expected_semi_found_reserved_identifier_str = expected `;`, found reserved identifier `{$token}` | |
344 | parse_expected_semi_found_keyword_str = expected `;`, found keyword `{$token}` | |
345 | parse_expected_semi_found_reserved_keyword_str = expected `;`, found reserved keyword `{$token}` | |
346 | parse_expected_semi_found_doc_comment_str = expected `;`, found doc comment `{$token}` | |
347 | parse_expected_semi_found_str = expected `;`, found `{$token}` | |
348 | ||
349 | parse_sugg_change_this_to_semi = change this to `;` | |
350 | parse_sugg_add_semi = add `;` here | |
351 | parse_label_unexpected_token = unexpected token | |
352 | ||
353 | parse_unmatched_angle_brackets = {$num_extra_brackets -> | |
354 | [one] unmatched angle bracket | |
355 | *[other] unmatched angle brackets | |
356 | } | |
357 | .suggestion = {$num_extra_brackets -> | |
358 | [one] remove extra angle bracket | |
359 | *[other] remove extra angle brackets | |
360 | } | |
361 | ||
362 | parse_generic_parameters_without_angle_brackets = generic parameters without surrounding angle brackets | |
363 | .suggestion = surround the type parameters with angle brackets | |
364 | ||
365 | parse_comparison_operators_cannot_be_chained = comparison operators cannot be chained | |
366 | .sugg_parentheses_for_function_args = or use `(...)` if you meant to specify fn arguments | |
367 | .sugg_split_comparison = split the comparison into two | |
368 | .sugg_parenthesize = parenthesize the comparison | |
369 | parse_sugg_turbofish_syntax = use `::<...>` instead of `<...>` to specify lifetime, type, or const arguments | |
370 | ||
371 | parse_question_mark_in_type = invalid `?` in type | |
372 | .label = `?` is only allowed on expressions, not types | |
373 | .suggestion = if you meant to express that the type might not contain a value, use the `Option` wrapper type | |
374 | ||
375 | parse_unexpected_parentheses_in_for_head = unexpected parentheses surrounding `for` loop head | |
376 | .suggestion = remove parentheses in `for` loop | |
377 | ||
378 | parse_doc_comment_on_param_type = documentation comments cannot be applied to a function parameter's type | |
379 | .label = doc comments are not allowed here | |
380 | ||
381 | parse_attribute_on_param_type = attributes cannot be applied to a function parameter's type | |
382 | .label = attributes are not allowed here | |
383 | ||
384 | parse_pattern_method_param_without_body = patterns aren't allowed in methods without bodies | |
385 | .suggestion = give this argument a name or use an underscore to ignore it | |
386 | ||
387 | parse_self_param_not_first = unexpected `self` parameter in function | |
388 | .label = must be the first parameter of an associated function | |
389 | ||
390 | parse_const_generic_without_braces = expressions must be enclosed in braces to be used as const generic arguments | |
391 | .suggestion = enclose the `const` expression in braces | |
392 | ||
393 | parse_unexpected_const_param_declaration = unexpected `const` parameter declaration | |
394 | .label = expected a `const` expression, not a parameter declaration | |
395 | .suggestion = `const` parameters must be declared for the `impl` | |
396 | ||
397 | parse_unexpected_const_in_generic_param = expected lifetime, type, or constant, found keyword `const` | |
398 | .suggestion = the `const` keyword is only needed in the definition of the type | |
399 | ||
400 | parse_async_move_order_incorrect = the order of `move` and `async` is incorrect | |
401 | .suggestion = try switching the order | |
402 | ||
403 | parse_double_colon_in_bound = expected `:` followed by trait or lifetime | |
404 | .suggestion = use single colon | |
405 | ||
406 | parse_fn_ptr_with_generics = function pointer types may not have generic parameters | |
407 | .suggestion = consider moving the lifetime {$arity -> | |
408 | [one] parameter | |
409 | *[other] parameters | |
410 | } to {$for_param_list_exists -> | |
411 | [true] the | |
412 | *[false] a | |
413 | } `for` parameter list | |
414 | ||
415 | parse_invalid_identifier_with_leading_number = expected identifier, found number literal | |
416 | .label = identifiers cannot start with a number | |
9c376795 FG |
417 | |
418 | parse_maybe_fn_typo_with_impl = you might have meant to write `impl` instead of `fn` | |
419 | .suggestion = replace `fn` with `impl` here | |
420 | ||
421 | parse_expected_fn_path_found_fn_keyword = expected identifier, found keyword `fn` | |
422 | .suggestion = use `Fn` to refer to the trait | |
423 | ||
424 | parse_where_clause_before_tuple_struct_body = where clauses are not allowed before tuple struct bodies | |
425 | .label = unexpected where clause | |
426 | .name_label = while parsing this tuple struct | |
427 | .body_label = the struct body | |
428 | .suggestion = move the body before the where clause | |
9ffffee4 FG |
429 | |
430 | parse_async_fn_in_2015 = `async fn` is not permitted in Rust 2015 | |
431 | .label = to use `async fn`, switch to Rust 2018 or later | |
432 | ||
433 | parse_async_block_in_2015 = `async` blocks are only allowed in Rust 2018 or later | |
434 | ||
435 | parse_self_argument_pointer = cannot pass `self` by raw pointer | |
436 | .label = cannot pass `self` by raw pointer | |
437 | ||
438 | parse_visibility_not_followed_by_item = visibility `{$vis}` is not followed by an item | |
439 | .label = the visibility | |
440 | .help = you likely meant to define an item, e.g., `{$vis} fn foo() {"{}"}` | |
441 | ||
442 | parse_default_not_followed_by_item = `default` is not followed by an item | |
443 | .label = the `default` qualifier | |
444 | .note = only `fn`, `const`, `type`, or `impl` items may be prefixed by `default` | |
445 | ||
446 | parse_missing_struct_for_struct_definition = missing `struct` for struct definition | |
447 | .suggestion = add `struct` here to parse `{$ident}` as a public struct | |
448 | ||
449 | parse_missing_fn_for_function_definition = missing `fn` for function definition | |
450 | .suggestion = add `fn` here to parse `{$ident}` as a public function | |
451 | ||
452 | parse_missing_fn_for_method_definition = missing `fn` for method definition | |
453 | .suggestion = add `fn` here to parse `{$ident}` as a public method | |
454 | ||
455 | parse_ambiguous_missing_keyword_for_item_definition = missing `fn` or `struct` for function or struct definition | |
456 | .suggestion = if you meant to call a macro, try | |
457 | .help = if you meant to call a macro, remove the `pub` and add a trailing `!` after the identifier | |
458 | ||
459 | parse_missing_trait_in_trait_impl = missing trait in a trait impl | |
460 | .suggestion_add_trait = add a trait here | |
461 | .suggestion_remove_for = for an inherent impl, drop this `for` | |
462 | ||
463 | parse_missing_for_in_trait_impl = missing `for` in a trait impl | |
464 | .suggestion = add `for` here | |
465 | ||
466 | parse_expected_trait_in_trait_impl_found_type = expected a trait, found type | |
467 | ||
468 | parse_non_item_in_item_list = non-item in item list | |
469 | .suggestion_use_const_not_let = consider using `const` instead of `let` for associated const | |
470 | .label_list_start = item list starts here | |
471 | .label_non_item = non-item starts here | |
472 | .label_list_end = item list ends here | |
473 | .suggestion_remove_semicolon = consider removing this semicolon | |
474 | ||
475 | parse_bounds_not_allowed_on_trait_aliases = bounds are not allowed on trait aliases | |
476 | ||
477 | parse_trait_alias_cannot_be_auto = trait aliases cannot be `auto` | |
478 | parse_trait_alias_cannot_be_unsafe = trait aliases cannot be `unsafe` | |
479 | ||
480 | parse_associated_static_item_not_allowed = associated `static` items are not allowed | |
481 | ||
482 | parse_extern_crate_name_with_dashes = crate name using dashes are not valid in `extern crate` statements | |
483 | .label = dash-separated idents are not valid | |
484 | .suggestion = if the original crate name uses dashes you need to use underscores in the code | |
485 | ||
486 | parse_extern_item_cannot_be_const = extern items cannot be `const` | |
487 | .suggestion = try using a static value | |
488 | .note = for more information, visit https://doc.rust-lang.org/std/keyword.extern.html | |
489 | ||
490 | parse_const_global_cannot_be_mutable = const globals cannot be mutable | |
491 | .label = cannot be mutable | |
492 | .suggestion = you might want to declare a static instead | |
493 | ||
494 | parse_missing_const_type = missing type for `{$kind}` item | |
495 | .suggestion = provide a type for the item | |
496 | ||
497 | parse_enum_struct_mutually_exclusive = `enum` and `struct` are mutually exclusive | |
498 | .suggestion = replace `enum struct` with | |
499 | ||
500 | parse_unexpected_token_after_struct_name = expected `where`, `{"{"}`, `(`, or `;` after struct name | |
501 | parse_unexpected_token_after_struct_name_found_reserved_identifier = expected `where`, `{"{"}`, `(`, or `;` after struct name, found reserved identifier `{$token}` | |
502 | parse_unexpected_token_after_struct_name_found_keyword = expected `where`, `{"{"}`, `(`, or `;` after struct name, found keyword `{$token}` | |
503 | parse_unexpected_token_after_struct_name_found_reserved_keyword = expected `where`, `{"{"}`, `(`, or `;` after struct name, found reserved keyword `{$token}` | |
504 | parse_unexpected_token_after_struct_name_found_doc_comment = expected `where`, `{"{"}`, `(`, or `;` after struct name, found doc comment `{$token}` | |
505 | parse_unexpected_token_after_struct_name_found_other = expected `where`, `{"{"}`, `(`, or `;` after struct name, found `{$token}` | |
506 | ||
507 | parse_unexpected_self_in_generic_parameters = unexpected keyword `Self` in generic parameters | |
508 | .note = you cannot use `Self` as a generic parameter because it is reserved for associated items | |
509 | ||
510 | parse_unexpected_default_value_for_lifetime_in_generic_parameters = unexpected default lifetime parameter | |
511 | .label = lifetime parameters cannot have default values | |
512 | ||
513 | parse_multiple_where_clauses = cannot define duplicate `where` clauses on an item | |
514 | .label = previous `where` clause starts here | |
515 | .suggestion = consider joining the two `where` clauses into one | |
516 | ||
517 | parse_nonterminal_expected_item_keyword = expected an item keyword | |
518 | parse_nonterminal_expected_statement = expected a statement | |
519 | parse_nonterminal_expected_ident = expected ident, found `{$token}` | |
520 | parse_nonterminal_expected_lifetime = expected a lifetime, found `{$token}` | |
521 | ||
522 | parse_or_pattern_not_allowed_in_let_binding = top-level or-patterns are not allowed in `let` bindings | |
523 | parse_or_pattern_not_allowed_in_fn_parameters = top-level or-patterns are not allowed in function parameters | |
524 | parse_sugg_remove_leading_vert_in_pattern = remove the `|` | |
525 | parse_sugg_wrap_pattern_in_parens = wrap the pattern in parentheses | |
526 | ||
527 | parse_note_pattern_alternatives_use_single_vert = alternatives in or-patterns are separated with `|`, not `||` | |
528 | ||
529 | parse_unexpected_vert_vert_before_function_parameter = unexpected `||` before function parameter | |
530 | .suggestion = remove the `||` | |
531 | ||
532 | parse_label_while_parsing_or_pattern_here = while parsing this or-pattern starting here | |
533 | ||
534 | parse_unexpected_vert_vert_in_pattern = unexpected token `||` in pattern | |
535 | .suggestion = use a single `|` to separate multiple alternative patterns | |
536 | ||
537 | parse_trailing_vert_not_allowed = a trailing `|` is not allowed in an or-pattern | |
538 | .suggestion = remove the `{$token}` | |
539 | ||
540 | parse_dotdotdot_rest_pattern = unexpected `...` | |
541 | .label = not a valid pattern | |
542 | .suggestion = for a rest pattern, use `..` instead of `...` | |
543 | ||
544 | parse_pattern_on_wrong_side_of_at = pattern on wrong side of `@` | |
545 | .label_pattern = pattern on the left, should be on the right | |
546 | .label_binding = binding on the right, should be on the left | |
547 | .suggestion = switch the order | |
548 | ||
549 | parse_expected_binding_left_of_at = left-hand side of `@` must be a binding | |
550 | .label_lhs = interpreted as a pattern, not a binding | |
551 | .label_rhs = also a pattern | |
552 | .note = bindings are `x`, `mut x`, `ref x`, and `ref mut x` | |
553 | ||
554 | parse_ambiguous_range_pattern = the range pattern here has ambiguous interpretation | |
555 | .suggestion = add parentheses to clarify the precedence | |
556 | ||
557 | parse_unexpected_lifetime_in_pattern = unexpected lifetime `{$symbol}` in pattern | |
558 | .suggestion = remove the lifetime | |
559 | ||
560 | parse_ref_mut_order_incorrect = the order of `mut` and `ref` is incorrect | |
561 | .suggestion = try switching the order | |
562 | ||
563 | parse_mut_on_nested_ident_pattern = `mut` must be attached to each individual binding | |
564 | .suggestion = add `mut` to each binding | |
565 | parse_mut_on_non_ident_pattern = `mut` must be followed by a named binding | |
566 | .suggestion = remove the `mut` prefix | |
567 | parse_note_mut_pattern_usage = `mut` may be followed by `variable` and `variable @ pattern` | |
568 | ||
569 | parse_repeated_mut_in_pattern = `mut` on a binding may not be repeated | |
570 | .suggestion = remove the additional `mut`s | |
571 | ||
572 | parse_dot_dot_dot_range_to_pattern_not_allowed = range-to patterns with `...` are not allowed | |
573 | .suggestion = use `..=` instead | |
574 | ||
575 | parse_enum_pattern_instead_of_identifier = expected identifier, found enum pattern | |
576 | ||
577 | parse_dot_dot_dot_for_remaining_fields = expected field pattern, found `{$token_str}` | |
578 | .suggestion = to omit remaining fields, use `..` | |
579 | ||
580 | parse_expected_comma_after_pattern_field = expected `,` | |
581 | ||
582 | parse_return_types_use_thin_arrow = return types are denoted using `->` | |
583 | .suggestion = use `->` instead | |
584 | ||
585 | parse_need_plus_after_trait_object_lifetime = lifetime in trait object type must be followed by `+` | |
586 | ||
587 | parse_expected_mut_or_const_in_raw_pointer_type = expected `mut` or `const` keyword in raw pointer type | |
588 | .suggestion = add `mut` or `const` here | |
589 | ||
590 | parse_lifetime_after_mut = lifetime must precede `mut` | |
591 | .suggestion = place the lifetime before `mut` | |
592 | ||
593 | parse_dyn_after_mut = `mut` must precede `dyn` | |
594 | .suggestion = place `mut` before `dyn` | |
595 | ||
596 | parse_fn_pointer_cannot_be_const = an `fn` pointer type cannot be `const` | |
597 | .label = `const` because of this | |
598 | .suggestion = remove the `const` qualifier | |
599 | ||
600 | parse_fn_pointer_cannot_be_async = an `fn` pointer type cannot be `async` | |
601 | .label = `async` because of this | |
602 | .suggestion = remove the `async` qualifier | |
603 | ||
604 | parse_nested_c_variadic_type = C-variadic type `...` may not be nested inside another type | |
605 | ||
606 | parse_invalid_dyn_keyword = invalid `dyn` keyword | |
607 | .help = `dyn` is only needed at the start of a trait `+`-separated list | |
608 | .suggestion = remove this keyword | |
609 | ||
610 | parse_negative_bounds_not_supported = negative bounds are not supported | |
611 | .label = negative bounds are not supported | |
612 | .suggestion = {$num_bounds -> | |
613 | [one] remove the bound | |
614 | *[other] remove the bounds | |
615 | } | |
616 | ||
617 | parse_help_set_edition_cargo = set `edition = "{$edition}"` in `Cargo.toml` | |
618 | parse_help_set_edition_standalone = pass `--edition {$edition}` to `rustc` | |
619 | parse_note_edition_guide = for more on editions, read https://doc.rust-lang.org/edition-guide | |
620 | ||
621 | parse_unexpected_token_after_dot = unexpected token: `{$actual}` | |
622 | ||
623 | parse_cannot_be_raw_ident = `{$ident}` cannot be a raw identifier | |
624 | ||
625 | parse_cr_doc_comment = bare CR not allowed in {$block -> | |
626 | [true] block doc-comment | |
627 | *[false] doc-comment | |
628 | } | |
629 | ||
630 | parse_no_digits_literal = no valid digits found for number | |
631 | ||
632 | parse_invalid_digit_literal = invalid digit for a base {$base} literal | |
633 | ||
634 | parse_empty_exponent_float = expected at least one digit in exponent | |
635 | ||
636 | parse_float_literal_unsupported_base = {$base} float literal is not supported | |
637 | ||
638 | parse_more_than_one_char = character literal may only contain one codepoint | |
639 | .followed_by = this `{$chr}` is followed by the combining {$len -> | |
640 | [one] mark | |
641 | *[other] marks | |
642 | } `{$escaped_marks}` | |
643 | .non_printing = there are non-printing characters, the full sequence is `{$escaped}` | |
644 | .consider_normalized = consider using the normalized form `{$ch}` of this character | |
645 | .remove_non = consider removing the non-printing characters | |
646 | .use_double_quotes = if you meant to write a {$is_byte -> | |
647 | [true] byte string | |
648 | *[false] `str` | |
649 | } literal, use double quotes | |
650 | ||
651 | parse_no_brace_unicode_escape = incorrect unicode escape sequence | |
652 | .label = {parse_no_brace_unicode_escape} | |
653 | .use_braces = format of unicode escape sequences uses braces | |
654 | .format_of_unicode = format of unicode escape sequences is `\u{"{...}"}` | |
655 | ||
656 | parse_invalid_unicode_escape = invalid unicode character escape | |
657 | .label = invalid escape | |
658 | .help = unicode escape must {$surrogate -> | |
659 | [true] not be a surrogate | |
660 | *[false] be at most 10FFFF | |
661 | } | |
662 | ||
663 | parse_escape_only_char = {$byte -> | |
664 | [true] byte | |
665 | *[false] character | |
666 | } constant must be escaped: `{$escaped_msg}` | |
667 | .escape = escape the character | |
668 | ||
669 | parse_bare_cr = {$double_quotes -> | |
670 | [true] bare CR not allowed in string, use `\r` instead | |
671 | *[false] character constant must be escaped: `\r` | |
672 | } | |
673 | .escape = escape the character | |
674 | ||
675 | parse_bare_cr_in_raw_string = bare CR not allowed in raw string | |
676 | ||
677 | parse_too_short_hex_escape = numeric character escape is too short | |
678 | ||
679 | parse_invalid_char_in_escape = {parse_invalid_char_in_escape_msg}: `{$ch}` | |
680 | .label = {parse_invalid_char_in_escape_msg} | |
681 | ||
682 | parse_invalid_char_in_escape_msg = invalid character in {$is_hex -> | |
683 | [true] numeric character | |
684 | *[false] unicode | |
685 | } escape | |
686 | ||
687 | parse_out_of_range_hex_escape = out of range hex escape | |
688 | .label = must be a character in the range [\x00-\x7f] | |
689 | ||
690 | parse_leading_underscore_unicode_escape = {parse_leading_underscore_unicode_escape_label}: `_` | |
691 | parse_leading_underscore_unicode_escape_label = invalid start of unicode escape | |
692 | ||
693 | parse_overlong_unicode_escape = overlong unicode escape | |
694 | .label = must have at most 6 hex digits | |
695 | ||
696 | parse_unclosed_unicode_escape = unterminated unicode escape | |
697 | .label = missing a closing `{"}"}` | |
698 | .terminate = terminate the unicode escape | |
699 | ||
700 | parse_unicode_escape_in_byte = unicode escape in byte string | |
701 | .label = {parse_unicode_escape_in_byte} | |
702 | .help = unicode escape sequences cannot be used as a byte or in a byte string | |
703 | ||
704 | parse_empty_unicode_escape = empty unicode escape | |
705 | .label = this escape must have at least 1 hex digit | |
706 | ||
707 | parse_zero_chars = empty character literal | |
708 | .label = {parse_zero_chars} | |
709 | ||
710 | parse_lone_slash = invalid trailing slash in literal | |
711 | .label = {parse_lone_slash} | |
712 | ||
713 | parse_unskipped_whitespace = non-ASCII whitespace symbol '{$ch}' is not skipped | |
714 | .label = {parse_unskipped_whitespace} | |
715 | ||
716 | parse_multiple_skipped_lines = multiple lines skipped by escaped newline | |
717 | .label = skipping everything up to and including this point | |
718 | ||
719 | parse_unknown_prefix = prefix `{$prefix}` is unknown | |
720 | .label = unknown prefix | |
721 | .note = prefixed identifiers and literals are reserved since Rust 2021 | |
722 | .suggestion_br = use `br` for a raw byte string | |
723 | .suggestion_whitespace = consider inserting whitespace here | |
724 | ||
725 | parse_too_many_hashes = too many `#` symbols: raw strings may be delimited by up to 255 `#` symbols, but found {$num} | |
726 | ||
727 | parse_unknown_start_of_token = unknown start of token: {$escaped} | |
728 | .sugg_quotes = Unicode characters '“' (Left Double Quotation Mark) and '”' (Right Double Quotation Mark) look like '{$ascii_str}' ({$ascii_name}), but are not | |
729 | .sugg_other = Unicode character '{$ch}' ({$u_name}) looks like '{$ascii_str}' ({$ascii_name}), but it is not | |
730 | .help_null = source files must contain UTF-8 encoded text, unexpected null bytes might occur when a different encoding is used | |
731 | .note_repeats = character appears {$repeats -> | |
732 | [one] once more | |
733 | *[other] {$repeats} more times | |
734 | } |