]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_error_messages/locales/en-US/parse.ftl
Auto merge of #107443 - cjgillot:generator-less-query, r=compiler-errors
[rust.git] / compiler / rustc_error_messages / locales / en-US / parse.ftl
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
5 parse_struct_literal_needing_parens =
6     invalid struct literal
7     .suggestion = you might need to surround the struct literal in parentheses
8
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
96 parse_missing_semicolon_before_array = expected `;`, found `[`
97     .suggestion = consider adding `;` here
98
99 parse_invalid_block_macro_segment = cannot use a `block` macro fragment here
100     .label = the `block` fragment is within this context
101
102 parse_expect_dotdot_not_dotdotdot = expected `..`, found `...`
103     .suggestion = use `..` to fill in the rest of the fields
104
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
108
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
112
113 parse_expected_expression_found_let = expected expression, found `let` statement
114
115 parse_expect_eq_instead_of_eqeq = expected `=`, found `==`
116     .suggestion = consider using `=` here
117
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
121
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
126
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
130
131 parse_missing_comma_after_match_arm = expected `,` following `match` arm
132     .suggestion = missing a comma here to end this `match` arm
133
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
136
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
140
141 parse_eq_field_init = expected `:`, found `=`
142     .suggestion = replace equals symbol with a colon
143
144 parse_dotdotdot = unexpected token: `...`
145     .suggest_exclusive_range = use `..` for an exclusive range
146     .suggest_inclusive_range = or `..=` for an inclusive range
147
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 `-`
150
151 parse_remove_let = expected pattern, found `let`
152     .suggestion = remove the unnecessary `let` keyword
153
154 parse_use_eq_instead = unexpected `==`
155     .suggestion = try using `=` instead
156
157 parse_use_empty_block_not_semi = expected { "`{}`" }, found `;`
158     .suggestion = try using { "`{}`" } instead
159
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
165
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
171
172 parse_found_expr_would_be_stmt = expected expression, found `{$token}`
173     .label = expected expression
174
175 parse_leading_plus_not_supported = leading `+` is not supported
176     .label = unexpected `+`
177     .suggestion_remove_plus = try removing the `+`
178
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
182
183 parse_labeled_loop_in_break = parentheses are required around this expression to avoid confusion with a labeled break expression
184
185 parse_sugg_wrap_expression_in_parentheses = wrap the expression in parentheses
186
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
189
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
194         }
195     .label_arrow = while parsing the `match` arm starting here
196     .suggestion_add_braces = surround the {$num_statements ->
197             [one] statement
198            *[other] statements
199         } with a body
200     .suggestion_use_comma_not_semicolon = use a comma to end a `match` arm expression
201
202 parse_inclusive_range_extra_equals = unexpected `=` after inclusive range
203     .suggestion_remove_eq = use `..=` instead
204     .note = inclusive ranges end with a single equals sign (`..=`)
205
206 parse_inclusive_range_match_arrow = unexpected `=>` after open range
207     .suggestion_add_space = add a space between the pattern and `=>`
208
209 parse_inclusive_range_no_end = inclusive range with no end
210     .suggestion_open_range = use `..` instead
211     .note = inclusive ranges must be bounded at the end (`..=b` or `a..=b`)
212
213 parse_struct_literal_not_allowed_here = struct literals are not allowed here
214     .suggestion = surround the struct literal with parentheses
215
216 parse_invalid_interpolated_expression = invalid interpolated expression
217
218 parse_invalid_literal_suffix_on_tuple_index = suffixes on a tuple index are invalid
219     .label = invalid suffix `{$suffix}`
220     .tuple_exception_line_1 = `{$suffix}` is *temporarily* accepted on tuple index fields as it was incorrectly accepted on stable for a few releases
221     .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
222     .tuple_exception_line_3 = see issue #60210 <https://github.com/rust-lang/rust/issues/60210> for more information
223
224 parse_non_string_abi_literal = non-string ABI literal
225     .suggestion = specify the ABI with a string literal
226
227 parse_mismatched_closing_delimiter = mismatched closing delimiter: `{$delimiter}`
228     .label_unmatched = mismatched closing delimiter
229     .label_opening_candidate = closing delimiter possibly meant for this
230     .label_unclosed = unclosed delimiter
231
232 parse_incorrect_visibility_restriction = incorrect visibility restriction
233     .help = some possible visibility restrictions are:
234             `pub(crate)`: visible only on the current crate
235             `pub(super)`: visible only in the current module's parent
236             `pub(in path::to::module)`: visible only on the specified path
237     .suggestion = make this visible only to module `{$inner_str}` with `in`
238
239 parse_assignment_else_not_allowed = <assignment> ... else {"{"} ... {"}"} is not allowed
240
241 parse_expected_statement_after_outer_attr = expected statement after outer attribute
242
243 parse_doc_comment_does_not_document_anything = found a documentation comment that doesn't document anything
244     .help = doc comments must come before what they document, if a comment was intended use `//`
245     .suggestion = missing comma here
246
247 parse_const_let_mutually_exclusive = `const` and `let` are mutually exclusive
248     .suggestion = remove `let`
249
250 parse_invalid_expression_in_let_else = a `{$operator}` expression cannot be directly assigned in `let...else`
251 parse_invalid_curly_in_let_else = right curly brace `{"}"}` before `else` in a `let...else` statement not allowed
252 parse_extra_if_in_let_else = remove the `if` if you meant to write a `let...else` statement
253
254 parse_compound_assignment_expression_in_let = can't reassign to an uninitialized variable
255     .suggestion = initialize the variable
256     .help = if you meant to overwrite, remove the `let` binding
257
258 parse_suffixed_literal_in_attribute = suffixed literals are not allowed in attributes
259     .help = instead of using a suffixed literal (`1u8`, `1.0f32`, etc.), use an unsuffixed version (`1`, `1.0`, etc.)
260
261 parse_invalid_meta_item = expected unsuffixed literal or identifier, found `{$token}`
262
263 parse_label_inner_attr_does_not_annotate_this = the inner attribute doesn't annotate this {$item}
264 parse_sugg_change_inner_attr_to_outer = to annotate the {$item}, change the attribute from inner to outer style
265
266 parse_inner_attr_not_permitted_after_outer_doc_comment = an inner attribute is not permitted following an outer doc comment
267     .label_attr = not permitted following an outer doc comment
268     .label_prev_doc_comment = previous doc comment
269     .label_does_not_annotate_this = {parse_label_inner_attr_does_not_annotate_this}
270     .sugg_change_inner_to_outer = {parse_sugg_change_inner_attr_to_outer}
271
272 parse_inner_attr_not_permitted_after_outer_attr = an inner attribute is not permitted following an outer attribute
273     .label_attr = not permitted following an outer attribute
274     .label_prev_attr = previous outer attribute
275     .label_does_not_annotate_this = {parse_label_inner_attr_does_not_annotate_this}
276     .sugg_change_inner_to_outer = {parse_sugg_change_inner_attr_to_outer}
277
278 parse_inner_attr_not_permitted = an inner attribute is not permitted in this context
279     .label_does_not_annotate_this = {parse_label_inner_attr_does_not_annotate_this}
280     .sugg_change_inner_to_outer = {parse_sugg_change_inner_attr_to_outer}
281
282 parse_inner_attr_explanation = inner attributes, like `#![no_std]`, annotate the item enclosing them, and are usually found at the beginning of source files
283 parse_outer_attr_explanation = outer attributes, like `#[test]`, annotate the item following them
284
285 parse_inner_doc_comment_not_permitted = expected outer doc comment
286     .note = inner doc comments like this (starting with `//!` or `/*!`) can only appear before items
287     .suggestion = you might have meant to write a regular comment
288     .label_does_not_annotate_this = the inner doc comment doesn't annotate this {$item}
289     .sugg_change_inner_to_outer = to annotate the {$item}, change the doc comment from inner to outer style
290
291 parse_expected_identifier_found_reserved_identifier_str = expected identifier, found reserved identifier `{$token}`
292 parse_expected_identifier_found_keyword_str = expected identifier, found keyword `{$token}`
293 parse_expected_identifier_found_reserved_keyword_str = expected identifier, found reserved keyword `{$token}`
294 parse_expected_identifier_found_doc_comment_str = expected identifier, found doc comment `{$token}`
295 parse_expected_identifier_found_str = expected identifier, found `{$token}`
296
297 parse_expected_identifier_found_reserved_identifier = expected identifier, found reserved identifier
298 parse_expected_identifier_found_keyword = expected identifier, found keyword
299 parse_expected_identifier_found_reserved_keyword = expected identifier, found reserved keyword
300 parse_expected_identifier_found_doc_comment = expected identifier, found doc comment
301 parse_expected_identifier = expected identifier
302
303 parse_sugg_escape_to_use_as_identifier = escape `{$ident_name}` to use it as an identifier
304
305 parse_sugg_remove_comma = remove this comma
306
307 parse_expected_semi_found_reserved_identifier_str = expected `;`, found reserved identifier `{$token}`
308 parse_expected_semi_found_keyword_str = expected `;`, found keyword `{$token}`
309 parse_expected_semi_found_reserved_keyword_str = expected `;`, found reserved keyword `{$token}`
310 parse_expected_semi_found_doc_comment_str = expected `;`, found doc comment `{$token}`
311 parse_expected_semi_found_str = expected `;`, found `{$token}`
312
313 parse_sugg_change_this_to_semi = change this to `;`
314 parse_sugg_add_semi = add `;` here
315 parse_label_unexpected_token = unexpected token
316
317 parse_unmatched_angle_brackets = {$num_extra_brackets ->
318         [one] unmatched angle bracket
319        *[other] unmatched angle brackets
320     }
321     .suggestion = {$num_extra_brackets ->
322             [one] remove extra angle bracket
323            *[other] remove extra angle brackets
324         }
325
326 parse_generic_parameters_without_angle_brackets = generic parameters without surrounding angle brackets
327     .suggestion = surround the type parameters with angle brackets
328
329 parse_comparison_operators_cannot_be_chained = comparison operators cannot be chained
330     .sugg_parentheses_for_function_args = or use `(...)` if you meant to specify fn arguments
331     .sugg_split_comparison = split the comparison into two
332     .sugg_parenthesize = parenthesize the comparison
333 parse_sugg_turbofish_syntax = use `::<...>` instead of `<...>` to specify lifetime, type, or const arguments
334
335 parse_question_mark_in_type = invalid `?` in type
336     .label = `?` is only allowed on expressions, not types
337     .suggestion = if you meant to express that the type might not contain a value, use the `Option` wrapper type
338
339 parse_unexpected_parentheses_in_for_head = unexpected parentheses surrounding `for` loop head
340     .suggestion = remove parentheses in `for` loop
341
342 parse_doc_comment_on_param_type = documentation comments cannot be applied to a function parameter's type
343     .label = doc comments are not allowed here
344
345 parse_attribute_on_param_type = attributes cannot be applied to a function parameter's type
346     .label = attributes are not allowed here
347
348 parse_pattern_method_param_without_body = patterns aren't allowed in methods without bodies
349     .suggestion = give this argument a name or use an underscore to ignore it
350
351 parse_self_param_not_first = unexpected `self` parameter in function
352     .label = must be the first parameter of an associated function
353
354 parse_const_generic_without_braces = expressions must be enclosed in braces to be used as const generic arguments
355     .suggestion = enclose the `const` expression in braces
356
357 parse_unexpected_const_param_declaration = unexpected `const` parameter declaration
358     .label = expected a `const` expression, not a parameter declaration
359     .suggestion = `const` parameters must be declared for the `impl`
360
361 parse_unexpected_const_in_generic_param = expected lifetime, type, or constant, found keyword `const`
362     .suggestion = the `const` keyword is only needed in the definition of the type
363
364 parse_async_move_order_incorrect = the order of `move` and `async` is incorrect
365     .suggestion = try switching the order
366
367 parse_double_colon_in_bound = expected `:` followed by trait or lifetime
368     .suggestion = use single colon
369
370 parse_fn_ptr_with_generics = function pointer types may not have generic parameters
371     .suggestion = consider moving the lifetime {$arity ->
372         [one] parameter
373         *[other] parameters
374     } to {$for_param_list_exists ->
375         [true] the
376         *[false] a
377     } `for` parameter list
378
379 parse_invalid_identifier_with_leading_number = expected identifier, found number literal
380     .label = identifiers cannot start with a number
381
382 parse_maybe_fn_typo_with_impl = you might have meant to write `impl` instead of `fn`
383     .suggestion = replace `fn` with `impl` here
384
385 parse_expected_fn_path_found_fn_keyword = expected identifier, found keyword `fn`
386     .suggestion = use `Fn` to refer to the trait
387
388 parse_where_clause_before_tuple_struct_body = where clauses are not allowed before tuple struct bodies
389     .label = unexpected where clause
390     .name_label = while parsing this tuple struct
391     .body_label = the struct body
392     .suggestion = move the body before the where clause