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
5 parser_maybe_report_ambiguous_plus =
6 ambiguous `+` in a type
7 .suggestion = use parentheses to disambiguate
9 parser_maybe_recover_from_bad_type_plus =
10 expected a path on the left-hand side of `+`, not `{$ty}`
12 parser_add_paren = try adding parentheses
14 parser_forgot_paren = perhaps you forgot parentheses?
16 parser_expect_path = expected a path
18 parser_maybe_recover_from_bad_qpath_stage_2 =
19 missing angle brackets in associated item path
20 .suggestion = try: `{$ty}`
22 parser_incorrect_semicolon =
23 expected item, found `;`
24 .suggestion = remove this semicolon
25 .help = {$name} declarations are not followed by a semicolon
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
33 expected iterable, found keyword `in`
34 .suggestion = remove the duplicated `in`
36 parser_invalid_variable_declaration =
37 invalid variable declaration
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
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`
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
54 parser_tilde_is_not_unary_operator = `~` cannot be used as a unary operator
55 .suggestion = use `!` to perform bitwise not
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
62 parser_malformed_loop_label = malformed loop label
63 .suggestion = use the correct loop label format
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
69 parser_field_expression_with_generic = field expressions cannot have generic arguments
71 parser_macro_invocation_with_qualified_path = macros cannot use qualified paths
73 parser_unexpected_token_after_label = expected `while`, `for`, `loop` or `{"{"}` after a label
75 parser_require_colon_after_labeled_expression = labeled expression must be followed by `:`
76 .note = labels are used before loops and blocks, allowing e.g., `break 'label` to them
78 .suggestion = add `:` after the label
80 parser_do_catch_syntax_removed = found removed `do catch` syntax
81 .note = following RFC #2388, the new non-placeholder syntax is `try`
82 .suggestion = replace with the new syntax
84 parser_float_literal_requires_integer_part = float literals must have an integer part
85 .suggestion = must have an integer part
87 parser_invalid_int_literal_width = invalid width `{$width}` for integer literal
88 .help = valid widths are 8, 16, 32, 64 and 128
90 parser_invalid_num_literal_base_prefix = invalid base prefix for number literal
91 .note = base prefixes (`0xff`, `0b1010`, `0o755`) are lowercase
92 .suggestion = try making the prefix lowercase
94 parser_invalid_num_literal_suffix = invalid suffix `{$suffix}` for number literal
95 .label = invalid suffix `{$suffix}`
96 .help = the suffix must be one of the numeric types (`u32`, `isize`, `f32`, etc.)
98 parser_invalid_float_literal_width = invalid width `{$width}` for float literal
99 .help = valid widths are 32 and 64
101 parser_invalid_float_literal_suffix = invalid suffix `{$suffix}` for float literal
102 .label = invalid suffix `{$suffix}`
103 .help = valid suffixes are `f32` and `f64`
105 parser_int_literal_too_large = integer literal is too large
107 parser_missing_semicolon_before_array = expected `;`, found `[`
108 .suggestion = consider adding `;` here
110 parser_invalid_block_macro_segment = cannot use a `block` macro fragment here
111 .label = the `block` fragment is within this context
113 parser_if_expression_missing_then_block = this `if` expression is missing a block after the condition
114 .add_then_block = add a block here
115 .condition_possibly_unfinished = this binary operation is possibly unfinished
117 parser_if_expression_missing_condition = missing condition for `if` expression
118 .condition_label = expected condition here
119 .block_label = if this block is the condition of the `if` expression, then it must be followed by another block
121 parser_expected_expression_found_let = expected expression, found `let` statement
123 parser_expected_else_block = expected `{"{"}`, found {$first_tok}
124 .label = expected an `if` or a block after this `else`
125 .suggestion = add an `if` if this is the condition of a chained `else if` statement
127 parser_outer_attribute_not_allowed_on_if_else = outer attributes are not allowed on `if` and `else` branches
128 .branch_label = the attributes are attached to this branch
129 .ctx_label = the branch belongs to this `{$ctx}`
130 .suggestion = remove the attributes
132 parser_missing_in_in_for_loop = missing `in` in `for` loop
133 .use_in_not_of = try using `in` here instead
134 .add_in = try adding `in` here
136 parser_missing_comma_after_match_arm = expected `,` following `match` arm
137 .suggestion = missing a comma here to end this `match` arm
139 parser_catch_after_try = keyword `catch` cannot follow a `try` block
140 .help = try using `match` on the result of the `try` block instead
142 parser_comma_after_base_struct = cannot use a comma after the base struct
143 .note = the base struct must always be the last field
144 .suggestion = remove this comma
146 parser_eq_field_init = expected `:`, found `=`
147 .suggestion = replace equals symbol with a colon
149 parser_dotdotdot = unexpected token: `...`
150 .suggest_exclusive_range = use `..` for an exclusive range
151 .suggest_inclusive_range = or `..=` for an inclusive range
153 parser_left_arrow_operator = unexpected token: `<-`
154 .suggestion = if you meant to write a comparison against a negative value, add a space in between `<` and `-`
156 parser_remove_let = expected pattern, found `let`
157 .suggestion = remove the unnecessary `let` keyword
159 parser_use_eq_instead = unexpected `==`
160 .suggestion = try using `=` instead
162 parser_use_empty_block_not_semi = expected { "`{}`" }, found `;`
163 .suggestion = try using { "`{}`" } instead