]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_error_messages/locales/en-US/parser.ftl
Rollup merge of #103778 - mati865:update-deps, r=Mark-Simulacrum
[rust.git] / compiler / rustc_error_messages / locales / en-US / parser.ftl
1 parser_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
5 parser_maybe_report_ambiguous_plus =
6     ambiguous `+` in a type
7     .suggestion = use parentheses to disambiguate
8
9 parser_maybe_recover_from_bad_type_plus =
10     expected a path on the left-hand side of `+`, not `{$ty}`
11
12 parser_add_paren = try adding parentheses
13
14 parser_forgot_paren = perhaps you forgot parentheses?
15
16 parser_expect_path = expected a path
17
18 parser_maybe_recover_from_bad_qpath_stage_2 =
19     missing angle brackets in associated item path
20     .suggestion = try: `{$ty}`
21
22 parser_incorrect_semicolon =
23     expected item, found `;`
24     .suggestion = remove this semicolon
25     .help = {$name} declarations are not followed by a semicolon
26
27 parser_incorrect_use_of_await =
28     incorrect use of `await`
29     .parentheses_suggestion = `await` is not a method call, remove the parentheses
30     .postfix_suggestion = `await` is a postfix operation
31
32 parser_in_in_typo =
33     expected iterable, found keyword `in`
34     .suggestion = remove the duplicated `in`
35
36 parser_invalid_variable_declaration =
37     invalid variable declaration
38
39 parser_switch_mut_let_order =
40     switch the order of `mut` and `let`
41 parser_missing_let_before_mut = missing keyword
42 parser_use_let_not_auto = write `let` instead of `auto` to introduce a new variable
43 parser_use_let_not_var = write `let` instead of `var` to introduce a new variable
44
45 parser_invalid_comparison_operator = invalid comparison operator `{$invalid}`
46     .use_instead = `{$invalid}` is not a valid comparison operator, use `{$correct}`
47     .spaceship_operator_invalid = `<=>` is not a valid comparison operator, use `std::cmp::Ordering`
48
49 parser_invalid_logical_operator = `{$incorrect}` is not a logical operator
50     .note = unlike in e.g., Python and PHP, `&&` and `||` are used for logical operators
51     .use_amp_amp_for_conjunction = use `&&` to perform logical conjunction
52     .use_pipe_pipe_for_disjunction = use `||` to perform logical disjunction
53
54 parser_tilde_is_not_unary_operator = `~` cannot be used as a unary operator
55     .suggestion = use `!` to perform bitwise not
56
57 parser_unexpected_token_after_not = unexpected {$negated_desc} after identifier
58 parser_unexpected_token_after_not_bitwise = use `!` to perform bitwise not
59 parser_unexpected_token_after_not_logical = use `!` to perform logical negation
60 parser_unexpected_token_after_not_default = use `!` to perform logical negation or bitwise not
61
62 parser_malformed_loop_label = malformed loop label
63     .suggestion = use the correct loop label format
64
65 parser_lifetime_in_borrow_expression = borrow expressions cannot be annotated with lifetimes
66     .suggestion = remove the lifetime annotation
67     .label = annotated with lifetime here
68
69 parser_field_expression_with_generic = field expressions cannot have generic arguments
70
71 parser_macro_invocation_with_qualified_path = macros cannot use qualified paths
72
73 parser_unexpected_token_after_label = expected `while`, `for`, `loop` or `{"{"}` after a label
74     .suggestion_remove_label = consider removing the label
75     .suggestion_enclose_in_block = consider enclosing expression in a block
76
77 parser_require_colon_after_labeled_expression = labeled expression must be followed by `:`
78     .note = labels are used before loops and blocks, allowing e.g., `break 'label` to them
79     .label = the label
80     .suggestion = add `:` after the label
81
82 parser_do_catch_syntax_removed = found removed `do catch` syntax
83     .note = following RFC #2388, the new non-placeholder syntax is `try`
84     .suggestion = replace with the new syntax
85
86 parser_float_literal_requires_integer_part = float literals must have an integer part
87     .suggestion = must have an integer part
88
89 parser_invalid_int_literal_width = invalid width `{$width}` for integer literal
90     .help = valid widths are 8, 16, 32, 64 and 128
91
92 parser_invalid_num_literal_base_prefix = invalid base prefix for number literal
93     .note = base prefixes (`0xff`, `0b1010`, `0o755`) are lowercase
94     .suggestion = try making the prefix lowercase
95
96 parser_invalid_num_literal_suffix = invalid suffix `{$suffix}` for number literal
97     .label = invalid suffix `{$suffix}`
98     .help = the suffix must be one of the numeric types (`u32`, `isize`, `f32`, etc.)
99
100 parser_invalid_float_literal_width = invalid width `{$width}` for float literal
101     .help = valid widths are 32 and 64
102
103 parser_invalid_float_literal_suffix = invalid suffix `{$suffix}` for float literal
104     .label = invalid suffix `{$suffix}`
105     .help = valid suffixes are `f32` and `f64`
106
107 parser_int_literal_too_large = integer literal is too large
108
109 parser_missing_semicolon_before_array = expected `;`, found `[`
110     .suggestion = consider adding `;` here
111
112 parser_invalid_block_macro_segment = cannot use a `block` macro fragment here
113     .label = the `block` fragment is within this context
114
115 parser_expect_dotdot_not_dotdotdot = expected `..`, found `...`
116     .suggestion = use `..` to fill in the rest of the fields
117
118 parser_if_expression_missing_then_block = this `if` expression is missing a block after the condition
119     .add_then_block = add a block here
120     .condition_possibly_unfinished = this binary operation is possibly unfinished
121
122 parser_if_expression_missing_condition = missing condition for `if` expression
123     .condition_label = expected condition here
124     .block_label = if this block is the condition of the `if` expression, then it must be followed by another block
125
126 parser_expected_expression_found_let = expected expression, found `let` statement
127
128 parser_expected_else_block = expected `{"{"}`, found {$first_tok}
129     .label = expected an `if` or a block after this `else`
130     .suggestion = add an `if` if this is the condition of a chained `else if` statement
131
132 parser_outer_attribute_not_allowed_on_if_else = outer attributes are not allowed on `if` and `else` branches
133     .branch_label = the attributes are attached to this branch
134     .ctx_label = the branch belongs to this `{$ctx}`
135     .suggestion = remove the attributes
136
137 parser_missing_in_in_for_loop = missing `in` in `for` loop
138     .use_in_not_of = try using `in` here instead
139     .add_in = try adding `in` here
140
141 parser_missing_comma_after_match_arm = expected `,` following `match` arm
142     .suggestion = missing a comma here to end this `match` arm
143
144 parser_catch_after_try = keyword `catch` cannot follow a `try` block
145     .help = try using `match` on the result of the `try` block instead
146
147 parser_comma_after_base_struct = cannot use a comma after the base struct
148     .note = the base struct must always be the last field
149     .suggestion = remove this comma
150
151 parser_eq_field_init = expected `:`, found `=`
152     .suggestion = replace equals symbol with a colon
153
154 parser_dotdotdot = unexpected token: `...`
155     .suggest_exclusive_range = use `..` for an exclusive range
156     .suggest_inclusive_range = or `..=` for an inclusive range
157
158 parser_left_arrow_operator = unexpected token: `<-`
159     .suggestion = if you meant to write a comparison against a negative value, add a space in between `<` and `-`
160
161 parser_remove_let = expected pattern, found `let`
162     .suggestion = remove the unnecessary `let` keyword
163
164 parser_use_eq_instead = unexpected `==`
165     .suggestion = try using `=` instead
166
167 parser_use_empty_block_not_semi = expected { "`{}`" }, found `;`
168     .suggestion = try using { "`{}`" } instead
169
170 parser_comparison_interpreted_as_generic =
171     `<` is interpreted as a start of generic arguments for `{$type}`, not a comparison
172     .label_args = interpreted as generic arguments
173     .label_comparison = not interpreted as comparison
174     .suggestion = try comparing the cast value
175
176 parser_shift_interpreted_as_generic =
177     `<<` is interpreted as a start of generic arguments for `{$type}`, not a shift
178     .label_args = interpreted as generic arguments
179     .label_comparison = not interpreted as shift
180     .suggestion = try shifting the cast value
181
182 parser_found_expr_would_be_stmt = expected expression, found `{$token}`
183     .label = expected expression
184
185 parser_leading_plus_not_supported = leading `+` is not supported
186     .label = unexpected `+`
187     .suggestion_remove_plus = try removing the `+`
188
189 parser_parentheses_with_struct_fields = invalid `struct` delimiters or `fn` call arguments
190     .suggestion_braces_for_struct = if `{$type}` is a struct, use braces as delimiters
191     .suggestion_no_fields_for_fn = if `{$type}` is a function, use the arguments directly
192
193 parser_labeled_loop_in_break = parentheses are required around this expression to avoid confusion with a labeled break expression
194
195 parser_sugg_wrap_expression_in_parentheses = wrap the expression in parentheses
196
197 parser_array_brackets_instead_of_braces = this is a block expression, not an array
198     .suggestion = to make an array, use square brackets instead of curly braces
199
200 parser_match_arm_body_without_braces = `match` arm body without braces
201     .label_statements = {$num_statements ->
202             [one] this statement is not surrounded by a body
203            *[other] these statements are not surrounded by a body
204         }
205     .label_arrow = while parsing the `match` arm starting here
206     .suggestion_add_braces = surround the {$num_statements ->
207             [one] statement
208            *[other] statements
209         } with a body
210     .suggestion_use_comma_not_semicolon = use a comma to end a `match` arm expression
211
212 parser_struct_literal_not_allowed_here = struct literals are not allowed here
213     .suggestion = surround the struct literal with parentheses
214
215 parser_invalid_interpolated_expression = invalid interpolated expression
216
217 parser_hexadecimal_float_literal_not_supported = hexadecimal float literal is not supported
218 parser_octal_float_literal_not_supported = octal float literal is not supported
219 parser_binary_float_literal_not_supported = binary float literal is not supported
220 parser_not_supported = not supported
221
222 parser_invalid_literal_suffix = suffixes on {$kind} literals are invalid
223     .label = invalid suffix `{$suffix}`
224
225 parser_invalid_literal_suffix_on_tuple_index = suffixes on a tuple index are invalid
226     .label = invalid suffix `{$suffix}`
227     .tuple_exception_line_1 = `{$suffix}` is *temporarily* accepted on tuple index fields as it was incorrectly accepted on stable for a few releases
228     .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
229     .tuple_exception_line_3 = see issue #60210 <https://github.com/rust-lang/rust/issues/60210> for more information
230
231 parser_non_string_abi_literal = non-string ABI literal
232     .suggestion = specify the ABI with a string literal
233
234 parser_mismatched_closing_delimiter = mismatched closing delimiter: `{$delimiter}`
235     .label_unmatched = mismatched closing delimiter
236     .label_opening_candidate = closing delimiter possibly meant for this
237     .label_unclosed = unclosed delimiter
238
239 parser_incorrect_visibility_restriction = incorrect visibility restriction
240     .help = some possible visibility restrictions are:
241             `pub(crate)`: visible only on the current crate
242             `pub(super)`: visible only in the current module's parent
243             `pub(in path::to::module)`: visible only on the specified path
244     .suggestion = make this visible only to module `{$inner_str}` with `in`
245
246 parser_assignment_else_not_allowed = <assignment> ... else {"{"} ... {"}"} is not allowed
247
248 parser_expected_statement_after_outer_attr = expected statement after outer attribute
249
250 parser_doc_comment_does_not_document_anything = found a documentation comment that doesn't document anything
251     .help = doc comments must come before what they document, if a comment was intended use `//`
252     .suggestion = missing comma here
253
254 parser_const_let_mutually_exclusive = `const` and `let` are mutually exclusive
255     .suggestion = remove `let`
256
257 parser_invalid_expression_in_let_else = a `{$operator}` expression cannot be directly assigned in `let...else`
258 parser_invalid_curly_in_let_else = right curly brace `{"}"}` before `else` in a `let...else` statement not allowed
259
260 parser_compound_assignment_expression_in_let = can't reassign to an uninitialized variable
261     .suggestion = initialize the variable
262     .help = if you meant to overwrite, remove the `let` binding
263
264 parser_suffixed_literal_in_attribute = suffixed literals are not allowed in attributes
265     .help = instead of using a suffixed literal (`1u8`, `1.0f32`, etc.), use an unsuffixed version (`1`, `1.0`, etc.)
266
267 parser_invalid_meta_item = expected unsuffixed literal or identifier, found `{$token}`
268
269 parser_label_inner_attr_does_not_annotate_this = the inner attribute doesn't annotate this {$item}
270 parser_sugg_change_inner_attr_to_outer = to annotate the {$item}, change the attribute from inner to outer style
271
272 parser_inner_attr_not_permitted_after_outer_doc_comment = an inner attribute is not permitted following an outer doc comment
273     .label_attr = not permitted following an outer doc comment
274     .label_prev_doc_comment = previous doc comment
275     .label_does_not_annotate_this = {parser_label_inner_attr_does_not_annotate_this}
276     .sugg_change_inner_to_outer = {parser_sugg_change_inner_attr_to_outer}
277
278 parser_inner_attr_not_permitted_after_outer_attr = an inner attribute is not permitted following an outer attribute
279     .label_attr = not permitted following an outer attribute
280     .label_prev_attr = previous outer attribute
281     .label_does_not_annotate_this = {parser_label_inner_attr_does_not_annotate_this}
282     .sugg_change_inner_to_outer = {parser_sugg_change_inner_attr_to_outer}
283
284 parser_inner_attr_not_permitted = an inner attribute is not permitted in this context
285     .label_does_not_annotate_this = {parser_label_inner_attr_does_not_annotate_this}
286     .sugg_change_inner_to_outer = {parser_sugg_change_inner_attr_to_outer}
287
288 parser_inner_attr_explanation = inner attributes, like `#![no_std]`, annotate the item enclosing them, and are usually found at the beginning of source files
289 parser_outer_attr_explanation = outer attributes, like `#[test]`, annotate the item following them
290
291 parser_inner_doc_comment_not_permitted = expected outer doc comment
292     .note = inner doc comments like this (starting with `//!` or `/*!`) can only appear before items
293     .suggestion = you might have meant to write a regular comment
294     .label_does_not_annotate_this = the inner doc comment doesn't annotate this {$item}
295     .sugg_change_inner_to_outer = to annotate the {$item}, change the doc comment from inner to outer style
296
297 parser_expected_identifier_found_reserved_identifier_str = expected identifier, found reserved identifier `{$token}`
298 parser_expected_identifier_found_keyword_str = expected identifier, found keyword `{$token}`
299 parser_expected_identifier_found_reserved_keyword_str = expected identifier, found reserved keyword `{$token}`
300 parser_expected_identifier_found_doc_comment_str = expected identifier, found doc comment `{$token}`
301 parser_expected_identifier_found_str = expected identifier, found `{$token}`
302
303 parser_expected_identifier_found_reserved_identifier = expected identifier, found reserved identifier
304 parser_expected_identifier_found_keyword = expected identifier, found keyword
305 parser_expected_identifier_found_reserved_keyword = expected identifier, found reserved keyword
306 parser_expected_identifier_found_doc_comment = expected identifier, found doc comment
307 parser_expected_identifier = expected identifier
308
309 parser_sugg_escape_to_use_as_identifier = escape `{$ident_name}` to use it as an identifier
310
311 parser_sugg_remove_comma = remove this comma
312
313 parser_expected_semi_found_reserved_identifier_str = expected `;`, found reserved identifier `{$token}`
314 parser_expected_semi_found_keyword_str = expected `;`, found keyword `{$token}`
315 parser_expected_semi_found_reserved_keyword_str = expected `;`, found reserved keyword `{$token}`
316 parser_expected_semi_found_doc_comment_str = expected `;`, found doc comment `{$token}`
317 parser_expected_semi_found_str = expected `;`, found `{$token}`
318
319 parser_sugg_change_this_to_semi = change this to `;`
320 parser_sugg_add_semi = add `;` here
321 parser_label_unexpected_token = unexpected token
322
323 parser_unmatched_angle_brackets = {$num_extra_brackets ->
324         [one] unmatched angle bracket
325        *[other] unmatched angle brackets
326     }
327     .suggestion = {$num_extra_brackets ->
328             [one] remove extra angle bracket
329            *[other] remove extra angle brackets
330         }
331
332 parser_generic_parameters_without_angle_brackets = generic parameters without surrounding angle brackets
333     .suggestion = surround the type parameters with angle brackets
334
335 parser_comparison_operators_cannot_be_chained = comparison operators cannot be chained
336     .sugg_parentheses_for_function_args = or use `(...)` if you meant to specify fn arguments
337     .sugg_split_comparison = split the comparison into two
338     .sugg_parenthesize = parenthesize the comparison
339 parser_sugg_turbofish_syntax = use `::<...>` instead of `<...>` to specify lifetime, type, or const arguments
340
341 parser_question_mark_in_type = invalid `?` in type
342     .label = `?` is only allowed on expressions, not types
343     .suggestion = if you meant to express that the type might not contain a value, use the `Option` wrapper type
344
345 parser_unexpected_parentheses_in_for_head = unexpected parentheses surrounding `for` loop head
346     .suggestion = remove parentheses in `for` loop
347
348 parser_doc_comment_on_param_type = documentation comments cannot be applied to a function parameter's type
349     .label = doc comments are not allowed here
350
351 parser_attribute_on_param_type = attributes cannot be applied to a function parameter's type
352     .label = attributes are not allowed here
353
354 parser_pattern_method_param_without_body = patterns aren't allowed in methods without bodies
355     .suggestion = give this argument a name or use an underscore to ignore it
356
357 parser_self_param_not_first = unexpected `self` parameter in function
358     .label = must be the first parameter of an associated function
359
360 parser_const_generic_without_braces = expressions must be enclosed in braces to be used as const generic arguments
361     .suggestion = enclose the `const` expression in braces
362
363 parser_unexpected_const_param_declaration = unexpected `const` parameter declaration
364     .label = expected a `const` expression, not a parameter declaration
365     .suggestion = `const` parameters must be declared for the `impl`
366
367 parser_unexpected_const_in_generic_param = expected lifetime, type, or constant, found keyword `const`
368     .suggestion = the `const` keyword is only needed in the definition of the type
369
370 parser_async_move_order_incorrect = the order of `move` and `async` is incorrect
371     .suggestion = try switching the order
372
373 parser_double_colon_in_bound = expected `:` followed by trait or lifetime
374     .suggestion = use single colon