]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_error_messages/locales/en-US/parse.ftl
Rollup merge of #105708 - tomerze:enable-atomic-cas-bpf, r=nagisa
[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_maybe_report_ambiguous_plus =
6     ambiguous `+` in a type
7     .suggestion = use parentheses to disambiguate
8
9 parse_maybe_recover_from_bad_type_plus =
10     expected a path on the left-hand side of `+`, not `{$ty}`
11
12 parse_add_paren = try adding parentheses
13
14 parse_forgot_paren = perhaps you forgot parentheses?
15
16 parse_expect_path = expected a path
17
18 parse_maybe_recover_from_bad_qpath_stage_2 =
19     missing angle brackets in associated item path
20     .suggestion = try: `{$ty}`
21
22 parse_incorrect_semicolon =
23     expected item, found `;`
24     .suggestion = remove this semicolon
25     .help = {$name} declarations are not followed by a semicolon
26
27 parse_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 parse_in_in_typo =
33     expected iterable, found keyword `in`
34     .suggestion = remove the duplicated `in`
35
36 parse_invalid_variable_declaration =
37     invalid variable declaration
38
39 parse_switch_mut_let_order =
40     switch the order of `mut` and `let`
41 parse_missing_let_before_mut = missing keyword
42 parse_use_let_not_auto = write `let` instead of `auto` to introduce a new variable
43 parse_use_let_not_var = write `let` instead of `var` to introduce a new variable
44
45 parse_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 parse_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 parse_tilde_is_not_unary_operator = `~` cannot be used as a unary operator
55     .suggestion = use `!` to perform bitwise not
56
57 parse_unexpected_if_with_if = unexpected `if` in the condition expression
58     .suggestion = remove the `if`
59
60 parse_unexpected_token_after_not = unexpected {$negated_desc} after identifier
61 parse_unexpected_token_after_not_bitwise = use `!` to perform bitwise not
62 parse_unexpected_token_after_not_logical = use `!` to perform logical negation
63 parse_unexpected_token_after_not_default = use `!` to perform logical negation or bitwise not
64
65 parse_malformed_loop_label = malformed loop label
66     .suggestion = use the correct loop label format
67
68 parse_lifetime_in_borrow_expression = borrow expressions cannot be annotated with lifetimes
69     .suggestion = remove the lifetime annotation
70     .label = annotated with lifetime here
71
72 parse_field_expression_with_generic = field expressions cannot have generic arguments
73
74 parse_macro_invocation_with_qualified_path = macros cannot use qualified paths
75
76 parse_unexpected_token_after_label = expected `while`, `for`, `loop` or `{"{"}` after a label
77     .suggestion_remove_label = consider removing the label
78     .suggestion_enclose_in_block = consider enclosing expression in a block
79
80 parse_require_colon_after_labeled_expression = labeled expression must be followed by `:`
81     .note = labels are used before loops and blocks, allowing e.g., `break 'label` to them
82     .label = the label
83     .suggestion = add `:` after the label
84
85 parse_do_catch_syntax_removed = found removed `do catch` syntax
86     .note = following RFC #2388, the new non-placeholder syntax is `try`
87     .suggestion = replace with the new syntax
88
89 parse_float_literal_requires_integer_part = float literals must have an integer part
90     .suggestion = must have an integer part
91
92 parse_missing_semicolon_before_array = expected `;`, found `[`
93     .suggestion = consider adding `;` here
94
95 parse_invalid_block_macro_segment = cannot use a `block` macro fragment here
96     .label = the `block` fragment is within this context
97
98 parse_expect_dotdot_not_dotdotdot = expected `..`, found `...`
99     .suggestion = use `..` to fill in the rest of the fields
100
101 parse_if_expression_missing_then_block = this `if` expression is missing a block after the condition
102     .add_then_block = add a block here
103     .condition_possibly_unfinished = this binary operation is possibly unfinished
104
105 parse_if_expression_missing_condition = missing condition for `if` expression
106     .condition_label = expected condition here
107     .block_label = if this block is the condition of the `if` expression, then it must be followed by another block
108
109 parse_expected_expression_found_let = expected expression, found `let` statement
110
111 parse_expect_eq_instead_of_eqeq = expected `=`, found `==`
112     .suggestion = consider using `=` here
113
114 parse_expected_else_block = expected `{"{"}`, found {$first_tok}
115     .label = expected an `if` or a block after this `else`
116     .suggestion = add an `if` if this is the condition of a chained `else if` statement
117
118 parse_outer_attribute_not_allowed_on_if_else = outer attributes are not allowed on `if` and `else` branches
119     .branch_label = the attributes are attached to this branch
120     .ctx_label = the branch belongs to this `{$ctx}`
121     .suggestion = remove the attributes
122
123 parse_missing_in_in_for_loop = missing `in` in `for` loop
124     .use_in_not_of = try using `in` here instead
125     .add_in = try adding `in` here
126
127 parse_missing_comma_after_match_arm = expected `,` following `match` arm
128     .suggestion = missing a comma here to end this `match` arm
129
130 parse_catch_after_try = keyword `catch` cannot follow a `try` block
131     .help = try using `match` on the result of the `try` block instead
132
133 parse_comma_after_base_struct = cannot use a comma after the base struct
134     .note = the base struct must always be the last field
135     .suggestion = remove this comma
136
137 parse_eq_field_init = expected `:`, found `=`
138     .suggestion = replace equals symbol with a colon
139
140 parse_dotdotdot = unexpected token: `...`
141     .suggest_exclusive_range = use `..` for an exclusive range
142     .suggest_inclusive_range = or `..=` for an inclusive range
143
144 parse_left_arrow_operator = unexpected token: `<-`
145     .suggestion = if you meant to write a comparison against a negative value, add a space in between `<` and `-`
146
147 parse_remove_let = expected pattern, found `let`
148     .suggestion = remove the unnecessary `let` keyword
149
150 parse_use_eq_instead = unexpected `==`
151     .suggestion = try using `=` instead
152
153 parse_use_empty_block_not_semi = expected { "`{}`" }, found `;`
154     .suggestion = try using { "`{}`" } instead
155
156 parse_comparison_interpreted_as_generic =
157     `<` is interpreted as a start of generic arguments for `{$type}`, not a comparison
158     .label_args = interpreted as generic arguments
159     .label_comparison = not interpreted as comparison
160     .suggestion = try comparing the cast value
161
162 parse_shift_interpreted_as_generic =
163     `<<` is interpreted as a start of generic arguments for `{$type}`, not a shift
164     .label_args = interpreted as generic arguments
165     .label_comparison = not interpreted as shift
166     .suggestion = try shifting the cast value
167
168 parse_found_expr_would_be_stmt = expected expression, found `{$token}`
169     .label = expected expression
170
171 parse_leading_plus_not_supported = leading `+` is not supported
172     .label = unexpected `+`
173     .suggestion_remove_plus = try removing the `+`
174
175 parse_parentheses_with_struct_fields = invalid `struct` delimiters or `fn` call arguments
176     .suggestion_braces_for_struct = if `{$type}` is a struct, use braces as delimiters
177     .suggestion_no_fields_for_fn = if `{$type}` is a function, use the arguments directly
178
179 parse_labeled_loop_in_break = parentheses are required around this expression to avoid confusion with a labeled break expression
180
181 parse_sugg_wrap_expression_in_parentheses = wrap the expression in parentheses
182
183 parse_array_brackets_instead_of_braces = this is a block expression, not an array
184     .suggestion = to make an array, use square brackets instead of curly braces
185
186 parse_match_arm_body_without_braces = `match` arm body without braces
187     .label_statements = {$num_statements ->
188             [one] this statement is not surrounded by a body
189            *[other] these statements are not surrounded by a body
190         }
191     .label_arrow = while parsing the `match` arm starting here
192     .suggestion_add_braces = surround the {$num_statements ->
193             [one] statement
194            *[other] statements
195         } with a body
196     .suggestion_use_comma_not_semicolon = use a comma to end a `match` arm expression
197
198 parse_struct_literal_not_allowed_here = struct literals are not allowed here
199     .suggestion = surround the struct literal with parentheses
200
201 parse_invalid_interpolated_expression = invalid interpolated expression
202
203 parse_invalid_literal_suffix_on_tuple_index = suffixes on a tuple index are invalid
204     .label = invalid suffix `{$suffix}`
205     .tuple_exception_line_1 = `{$suffix}` is *temporarily* accepted on tuple index fields as it was incorrectly accepted on stable for a few releases
206     .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
207     .tuple_exception_line_3 = see issue #60210 <https://github.com/rust-lang/rust/issues/60210> for more information
208
209 parse_non_string_abi_literal = non-string ABI literal
210     .suggestion = specify the ABI with a string literal
211
212 parse_mismatched_closing_delimiter = mismatched closing delimiter: `{$delimiter}`
213     .label_unmatched = mismatched closing delimiter
214     .label_opening_candidate = closing delimiter possibly meant for this
215     .label_unclosed = unclosed delimiter
216
217 parse_incorrect_visibility_restriction = incorrect visibility restriction
218     .help = some possible visibility restrictions are:
219             `pub(crate)`: visible only on the current crate
220             `pub(super)`: visible only in the current module's parent
221             `pub(in path::to::module)`: visible only on the specified path
222     .suggestion = make this visible only to module `{$inner_str}` with `in`
223
224 parse_assignment_else_not_allowed = <assignment> ... else {"{"} ... {"}"} is not allowed
225
226 parse_expected_statement_after_outer_attr = expected statement after outer attribute
227
228 parse_doc_comment_does_not_document_anything = found a documentation comment that doesn't document anything
229     .help = doc comments must come before what they document, if a comment was intended use `//`
230     .suggestion = missing comma here
231
232 parse_const_let_mutually_exclusive = `const` and `let` are mutually exclusive
233     .suggestion = remove `let`
234
235 parse_invalid_expression_in_let_else = a `{$operator}` expression cannot be directly assigned in `let...else`
236 parse_invalid_curly_in_let_else = right curly brace `{"}"}` before `else` in a `let...else` statement not allowed
237
238 parse_compound_assignment_expression_in_let = can't reassign to an uninitialized variable
239     .suggestion = initialize the variable
240     .help = if you meant to overwrite, remove the `let` binding
241
242 parse_suffixed_literal_in_attribute = suffixed literals are not allowed in attributes
243     .help = instead of using a suffixed literal (`1u8`, `1.0f32`, etc.), use an unsuffixed version (`1`, `1.0`, etc.)
244
245 parse_invalid_meta_item = expected unsuffixed literal or identifier, found `{$token}`
246
247 parse_label_inner_attr_does_not_annotate_this = the inner attribute doesn't annotate this {$item}
248 parse_sugg_change_inner_attr_to_outer = to annotate the {$item}, change the attribute from inner to outer style
249
250 parse_inner_attr_not_permitted_after_outer_doc_comment = an inner attribute is not permitted following an outer doc comment
251     .label_attr = not permitted following an outer doc comment
252     .label_prev_doc_comment = previous doc comment
253     .label_does_not_annotate_this = {parse_label_inner_attr_does_not_annotate_this}
254     .sugg_change_inner_to_outer = {parse_sugg_change_inner_attr_to_outer}
255
256 parse_inner_attr_not_permitted_after_outer_attr = an inner attribute is not permitted following an outer attribute
257     .label_attr = not permitted following an outer attribute
258     .label_prev_attr = previous outer attribute
259     .label_does_not_annotate_this = {parse_label_inner_attr_does_not_annotate_this}
260     .sugg_change_inner_to_outer = {parse_sugg_change_inner_attr_to_outer}
261
262 parse_inner_attr_not_permitted = an inner attribute is not permitted in this context
263     .label_does_not_annotate_this = {parse_label_inner_attr_does_not_annotate_this}
264     .sugg_change_inner_to_outer = {parse_sugg_change_inner_attr_to_outer}
265
266 parse_inner_attr_explanation = inner attributes, like `#![no_std]`, annotate the item enclosing them, and are usually found at the beginning of source files
267 parse_outer_attr_explanation = outer attributes, like `#[test]`, annotate the item following them
268
269 parse_inner_doc_comment_not_permitted = expected outer doc comment
270     .note = inner doc comments like this (starting with `//!` or `/*!`) can only appear before items
271     .suggestion = you might have meant to write a regular comment
272     .label_does_not_annotate_this = the inner doc comment doesn't annotate this {$item}
273     .sugg_change_inner_to_outer = to annotate the {$item}, change the doc comment from inner to outer style
274
275 parse_expected_identifier_found_reserved_identifier_str = expected identifier, found reserved identifier `{$token}`
276 parse_expected_identifier_found_keyword_str = expected identifier, found keyword `{$token}`
277 parse_expected_identifier_found_reserved_keyword_str = expected identifier, found reserved keyword `{$token}`
278 parse_expected_identifier_found_doc_comment_str = expected identifier, found doc comment `{$token}`
279 parse_expected_identifier_found_str = expected identifier, found `{$token}`
280
281 parse_expected_identifier_found_reserved_identifier = expected identifier, found reserved identifier
282 parse_expected_identifier_found_keyword = expected identifier, found keyword
283 parse_expected_identifier_found_reserved_keyword = expected identifier, found reserved keyword
284 parse_expected_identifier_found_doc_comment = expected identifier, found doc comment
285 parse_expected_identifier = expected identifier
286
287 parse_sugg_escape_to_use_as_identifier = escape `{$ident_name}` to use it as an identifier
288
289 parse_sugg_remove_comma = remove this comma
290
291 parse_expected_semi_found_reserved_identifier_str = expected `;`, found reserved identifier `{$token}`
292 parse_expected_semi_found_keyword_str = expected `;`, found keyword `{$token}`
293 parse_expected_semi_found_reserved_keyword_str = expected `;`, found reserved keyword `{$token}`
294 parse_expected_semi_found_doc_comment_str = expected `;`, found doc comment `{$token}`
295 parse_expected_semi_found_str = expected `;`, found `{$token}`
296
297 parse_sugg_change_this_to_semi = change this to `;`
298 parse_sugg_add_semi = add `;` here
299 parse_label_unexpected_token = unexpected token
300
301 parse_unmatched_angle_brackets = {$num_extra_brackets ->
302         [one] unmatched angle bracket
303        *[other] unmatched angle brackets
304     }
305     .suggestion = {$num_extra_brackets ->
306             [one] remove extra angle bracket
307            *[other] remove extra angle brackets
308         }
309
310 parse_generic_parameters_without_angle_brackets = generic parameters without surrounding angle brackets
311     .suggestion = surround the type parameters with angle brackets
312
313 parse_comparison_operators_cannot_be_chained = comparison operators cannot be chained
314     .sugg_parentheses_for_function_args = or use `(...)` if you meant to specify fn arguments
315     .sugg_split_comparison = split the comparison into two
316     .sugg_parenthesize = parenthesize the comparison
317 parse_sugg_turbofish_syntax = use `::<...>` instead of `<...>` to specify lifetime, type, or const arguments
318
319 parse_question_mark_in_type = invalid `?` in type
320     .label = `?` is only allowed on expressions, not types
321     .suggestion = if you meant to express that the type might not contain a value, use the `Option` wrapper type
322
323 parse_unexpected_parentheses_in_for_head = unexpected parentheses surrounding `for` loop head
324     .suggestion = remove parentheses in `for` loop
325
326 parse_doc_comment_on_param_type = documentation comments cannot be applied to a function parameter's type
327     .label = doc comments are not allowed here
328
329 parse_attribute_on_param_type = attributes cannot be applied to a function parameter's type
330     .label = attributes are not allowed here
331
332 parse_pattern_method_param_without_body = patterns aren't allowed in methods without bodies
333     .suggestion = give this argument a name or use an underscore to ignore it
334
335 parse_self_param_not_first = unexpected `self` parameter in function
336     .label = must be the first parameter of an associated function
337
338 parse_const_generic_without_braces = expressions must be enclosed in braces to be used as const generic arguments
339     .suggestion = enclose the `const` expression in braces
340
341 parse_unexpected_const_param_declaration = unexpected `const` parameter declaration
342     .label = expected a `const` expression, not a parameter declaration
343     .suggestion = `const` parameters must be declared for the `impl`
344
345 parse_unexpected_const_in_generic_param = expected lifetime, type, or constant, found keyword `const`
346     .suggestion = the `const` keyword is only needed in the definition of the type
347
348 parse_async_move_order_incorrect = the order of `move` and `async` is incorrect
349     .suggestion = try switching the order
350
351 parse_double_colon_in_bound = expected `:` followed by trait or lifetime
352     .suggestion = use single colon
353
354 parse_fn_ptr_with_generics = function pointer types may not have generic parameters
355     .suggestion = consider moving the lifetime {$arity ->
356         [one] parameter
357         *[other] parameters
358     } to {$for_param_list_exists ->
359         [true] the
360         *[false] a
361     } `for` parameter list
362
363 parse_invalid_identifier_with_leading_number = expected identifier, found number literal
364     .label = identifiers cannot start with a number
365
366 parse_maybe_fn_typo_with_impl = you might have meant to write `impl` instead of `fn`
367     .suggestion = replace `fn` with `impl` here
368
369 parse_expected_fn_path_found_fn_keyword = expected identifier, found keyword `fn`
370     .suggestion = use `Fn` to refer to the trait