1 mir_build_unconditional_recursion = function cannot return without recursing
2 .label = cannot return without recursing
3 .help = a `loop` may express intention better if this is on purpose
5 mir_build_unconditional_recursion_call_site_label = recursive call site
7 mir_build_unsafe_op_in_unsafe_fn_call_to_unsafe_fn_requires_unsafe =
8 call to unsafe function `{$function}` is unsafe and requires unsafe block (error E0133)
9 .note = consult the function's documentation for information on how to avoid undefined behavior
10 .label = call to unsafe function
12 mir_build_unsafe_op_in_unsafe_fn_call_to_unsafe_fn_requires_unsafe_nameless =
13 call to unsafe function is unsafe and requires unsafe block (error E0133)
14 .note = consult the function's documentation for information on how to avoid undefined behavior
15 .label = call to unsafe function
17 mir_build_unsafe_op_in_unsafe_fn_inline_assembly_requires_unsafe =
18 use of inline assembly is unsafe and requires unsafe block (error E0133)
19 .note = inline assembly is entirely unchecked and can cause undefined behavior
20 .label = use of inline assembly
22 mir_build_unsafe_op_in_unsafe_fn_initializing_type_with_requires_unsafe =
23 initializing type with `rustc_layout_scalar_valid_range` attr is unsafe and requires unsafe
25 .note = initializing a layout restricted type's field with a value outside the valid range is undefined behavior
26 .label = initializing type with `rustc_layout_scalar_valid_range` attr
28 mir_build_unsafe_op_in_unsafe_fn_mutable_static_requires_unsafe =
29 use of mutable static is unsafe and requires unsafe block (error E0133)
30 .note = mutable statics can be mutated by multiple threads: aliasing violations or data races will cause undefined behavior
31 .label = use of mutable static
33 mir_build_unsafe_op_in_unsafe_fn_extern_static_requires_unsafe =
34 use of extern static is unsafe and requires unsafe block (error E0133)
35 .note = extern statics are not controlled by the Rust type system: invalid data, aliasing violations or data races will cause undefined behavior
36 .label = use of extern static
38 mir_build_unsafe_op_in_unsafe_fn_deref_raw_pointer_requires_unsafe =
39 dereference of raw pointer is unsafe and requires unsafe block (error E0133)
40 .note = raw pointers may be null, dangling or unaligned; they can violate aliasing rules and cause data races: all of these are undefined behavior
41 .label = dereference of raw pointer
43 mir_build_unsafe_op_in_unsafe_fn_union_field_requires_unsafe =
44 access to union field is unsafe and requires unsafe block (error E0133)
45 .note = the field may not be properly initialized: using uninitialized data will cause undefined behavior
46 .label = access to union field
48 mir_build_unsafe_op_in_unsafe_fn_mutation_of_layout_constrained_field_requires_unsafe =
49 mutation of layout constrained field is unsafe and requires unsafe block (error E0133)
50 .note = mutating layout constrained fields cannot statically be checked for valid values
51 .label = mutation of layout constrained field
53 mir_build_unsafe_op_in_unsafe_fn_borrow_of_layout_constrained_field_requires_unsafe =
54 borrow of layout constrained field with interior mutability is unsafe and requires unsafe block (error E0133)
55 .note = references to fields of layout constrained fields lose the constraints. Coupled with interior mutability, the field can be changed to invalid values
56 .label = borrow of layout constrained field with interior mutability
58 mir_build_unsafe_op_in_unsafe_fn_call_to_fn_with_requires_unsafe =
59 call to function `{$function}` with `#[target_feature]` is unsafe and requires unsafe block (error E0133)
60 .note = can only be called if the required target features are available
61 .label = call to function with `#[target_feature]`
63 mir_build_call_to_unsafe_fn_requires_unsafe =
64 call to unsafe function `{$function}` is unsafe and requires unsafe block
65 .note = consult the function's documentation for information on how to avoid undefined behavior
66 .label = call to unsafe function
68 mir_build_call_to_unsafe_fn_requires_unsafe_nameless =
69 call to unsafe function is unsafe and requires unsafe block
70 .note = consult the function's documentation for information on how to avoid undefined behavior
71 .label = call to unsafe function
73 mir_build_call_to_unsafe_fn_requires_unsafe_unsafe_op_in_unsafe_fn_allowed =
74 call to unsafe function `{$function}` is unsafe and requires unsafe function or block
75 .note = consult the function's documentation for information on how to avoid undefined behavior
76 .label = call to unsafe function
78 mir_build_call_to_unsafe_fn_requires_unsafe_nameless_unsafe_op_in_unsafe_fn_allowed =
79 call to unsafe function is unsafe and requires unsafe function or block
80 .note = consult the function's documentation for information on how to avoid undefined behavior
81 .label = call to unsafe function
83 mir_build_inline_assembly_requires_unsafe =
84 use of inline assembly is unsafe and requires unsafe block
85 .note = inline assembly is entirely unchecked and can cause undefined behavior
86 .label = use of inline assembly
88 mir_build_inline_assembly_requires_unsafe_unsafe_op_in_unsafe_fn_allowed =
89 use of inline assembly is unsafe and requires unsafe function or block
90 .note = inline assembly is entirely unchecked and can cause undefined behavior
91 .label = use of inline assembly
93 mir_build_initializing_type_with_requires_unsafe =
94 initializing type with `rustc_layout_scalar_valid_range` attr is unsafe and requires unsafe block
95 .note = initializing a layout restricted type's field with a value outside the valid range is undefined behavior
96 .label = initializing type with `rustc_layout_scalar_valid_range` attr
98 mir_build_initializing_type_with_requires_unsafe_unsafe_op_in_unsafe_fn_allowed =
99 initializing type with `rustc_layout_scalar_valid_range` attr is unsafe and requires unsafe function or block
100 .note = initializing a layout restricted type's field with a value outside the valid range is undefined behavior
101 .label = initializing type with `rustc_layout_scalar_valid_range` attr
103 mir_build_mutable_static_requires_unsafe =
104 use of mutable static is unsafe and requires unsafe block
105 .note = mutable statics can be mutated by multiple threads: aliasing violations or data races will cause undefined behavior
106 .label = use of mutable static
108 mir_build_mutable_static_requires_unsafe_unsafe_op_in_unsafe_fn_allowed =
109 use of mutable static is unsafe and requires unsafe function or block
110 .note = mutable statics can be mutated by multiple threads: aliasing violations or data races will cause undefined behavior
111 .label = use of mutable static
113 mir_build_extern_static_requires_unsafe =
114 use of extern static is unsafe and requires unsafe block
115 .note = extern statics are not controlled by the Rust type system: invalid data, aliasing violations or data races will cause undefined behavior
116 .label = use of extern static
118 mir_build_extern_static_requires_unsafe_unsafe_op_in_unsafe_fn_allowed =
119 use of extern static is unsafe and requires unsafe function or block
120 .note = extern statics are not controlled by the Rust type system: invalid data, aliasing violations or data races will cause undefined behavior
121 .label = use of extern static
123 mir_build_deref_raw_pointer_requires_unsafe =
124 dereference of raw pointer is unsafe and requires unsafe block
125 .note = raw pointers may be null, dangling or unaligned; they can violate aliasing rules and cause data races: all of these are undefined behavior
126 .label = dereference of raw pointer
128 mir_build_deref_raw_pointer_requires_unsafe_unsafe_op_in_unsafe_fn_allowed =
129 dereference of raw pointer is unsafe and requires unsafe function or block
130 .note = raw pointers may be null, dangling or unaligned; they can violate aliasing rules and cause data races: all of these are undefined behavior
131 .label = dereference of raw pointer
133 mir_build_union_field_requires_unsafe =
134 access to union field is unsafe and requires unsafe block
135 .note = the field may not be properly initialized: using uninitialized data will cause undefined behavior
136 .label = access to union field
138 mir_build_union_field_requires_unsafe_unsafe_op_in_unsafe_fn_allowed =
139 access to union field is unsafe and requires unsafe function or block
140 .note = the field may not be properly initialized: using uninitialized data will cause undefined behavior
141 .label = access to union field
143 mir_build_mutation_of_layout_constrained_field_requires_unsafe =
144 mutation of layout constrained field is unsafe and requires unsafe block
145 .note = mutating layout constrained fields cannot statically be checked for valid values
146 .label = mutation of layout constrained field
148 mir_build_mutation_of_layout_constrained_field_requires_unsafe_unsafe_op_in_unsafe_fn_allowed =
149 mutation of layout constrained field is unsafe and requires unsafe function or block
150 .note = mutating layout constrained fields cannot statically be checked for valid values
151 .label = mutation of layout constrained field
153 mir_build_borrow_of_layout_constrained_field_requires_unsafe =
154 borrow of layout constrained field with interior mutability is unsafe and requires unsafe block
155 .note = references to fields of layout constrained fields lose the constraints. Coupled with interior mutability, the field can be changed to invalid values
156 .label = borrow of layout constrained field with interior mutability
158 mir_build_borrow_of_layout_constrained_field_requires_unsafe_unsafe_op_in_unsafe_fn_allowed =
159 borrow of layout constrained field with interior mutability is unsafe and requires unsafe function or block
160 .note = references to fields of layout constrained fields lose the constraints. Coupled with interior mutability, the field can be changed to invalid values
161 .label = borrow of layout constrained field with interior mutability
163 mir_build_call_to_fn_with_requires_unsafe =
164 call to function `{$function}` with `#[target_feature]` is unsafe and requires unsafe block
165 .note = can only be called if the required target features are available
166 .label = call to function with `#[target_feature]`
168 mir_build_call_to_fn_with_requires_unsafe_unsafe_op_in_unsafe_fn_allowed =
169 call to function `{$function}` with `#[target_feature]` is unsafe and requires unsafe function or block
170 .note = can only be called if the required target features are available
171 .label = call to function with `#[target_feature]`
173 mir_build_unused_unsafe = unnecessary `unsafe` block
174 .label = unnecessary `unsafe` block
176 mir_build_unused_unsafe_enclosing_block_label = because it's nested under this `unsafe` block
177 mir_build_unused_unsafe_enclosing_fn_label = because it's nested under this `unsafe` fn
179 mir_build_non_exhaustive_patterns_type_not_empty = non-exhaustive patterns: type `{$ty}` is non-empty
180 .def_note = `{$peeled_ty}` defined here
181 .type_note = the matched value is of type `{$ty}`
182 .non_exhaustive_type_note = the matched value is of type `{$ty}`, which is marked as non-exhaustive
183 .reference_note = references are always considered inhabited
184 .suggestion = ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown
185 .help = ensure that all possible cases are being handled by adding a match arm with a wildcard pattern
187 mir_build_static_in_pattern = statics cannot be referenced in patterns
189 mir_build_assoc_const_in_pattern = associated consts cannot be referenced in patterns
191 mir_build_const_param_in_pattern = const parameters cannot be referenced in patterns
193 mir_build_non_const_path = runtime values cannot be referenced in patterns
195 mir_build_unreachable_pattern = unreachable pattern
196 .label = unreachable pattern
197 .catchall_label = matches any value
199 mir_build_const_pattern_depends_on_generic_parameter =
200 constant pattern depends on a generic parameter
202 mir_build_could_not_eval_const_pattern = could not evaluate constant pattern
204 mir_build_lower_range_bound_must_be_less_than_or_equal_to_upper =
205 lower range bound must be less than or equal to upper
206 .label = lower bound larger than upper bound
207 .teach_note = When matching against a range, the compiler verifies that the range is non-empty. Range patterns include both end-points, so this is equivalent to requiring the start of the range to be less than or equal to the end of the range.
209 mir_build_literal_in_range_out_of_bounds =
210 literal out of range for `{$ty}`
211 .label = this value doesn't fit in `{$ty}` whose maximum value is `{$max}`
213 mir_build_lower_range_bound_must_be_less_than_upper = lower range bound must be less than upper
215 mir_build_leading_irrefutable_let_patterns = leading irrefutable {$count ->
221 *[other] these patterns
223 .help = consider moving {$count ->
226 } outside of the construct
228 mir_build_trailing_irrefutable_let_patterns = trailing irrefutable {$count ->
234 *[other] these patterns
236 .help = consider moving {$count ->
241 mir_build_bindings_with_variant_name =
242 pattern binding `{$ident}` is named the same as one of the variants of the type `{$ty_path}`
243 .suggestion = to match on the variant, qualify the path
245 mir_build_irrefutable_let_patterns_generic_let = irrefutable `let` {$count ->
251 *[other] these patterns
252 } will always match, so the `let` is useless
253 .help = consider removing `let`
255 mir_build_irrefutable_let_patterns_if_let = irrefutable `if let` {$count ->
261 *[other] these patterns
262 } will always match, so the `if let` is useless
263 .help = consider replacing the `if let` with a `let`
265 mir_build_irrefutable_let_patterns_if_let_guard = irrefutable `if let` guard {$count ->
271 *[other] these patterns
272 } will always match, so the guard is useless
273 .help = consider removing the guard and adding a `let` inside the match arm
275 mir_build_irrefutable_let_patterns_let_else = irrefutable `let...else` {$count ->
281 *[other] these patterns
282 } will always match, so the `else` clause is useless
283 .help = consider removing the `else` clause
285 mir_build_irrefutable_let_patterns_while_let = irrefutable `while let` {$count ->
291 *[other] these patterns
292 } will always match, so the loop will never exit
293 .help = consider instead using a `loop {"{"} ... {"}"}` with a `let` inside it
295 mir_build_borrow_of_moved_value = borrow of moved value
296 .label = value moved into `{$name}` here
297 .occurs_because_label = move occurs because `{$name}` has type `{$ty}` which does not implement the `Copy` trait
298 .value_borrowed_label = value borrowed here after move
299 .suggestion = borrow this binding in the pattern to avoid moving the value
301 mir_build_multiple_mut_borrows = cannot borrow value as mutable more than once at a time
302 .label = first mutable borrow, by `{$name}`, occurs here
303 .mutable_borrow = another mutable borrow, by `{$name_mut}`, occurs here
304 .immutable_borrow = also borrowed as immutable, by `{$name_immut}`, here
305 .moved = also moved into `{$name_moved}` here
307 mir_build_union_pattern = cannot use unions in constant patterns
309 mir_build_type_not_structural =
310 to use a constant of type `{$non_sm_ty}` in a pattern, `{$non_sm_ty}` must be annotated with `#[derive(PartialEq, Eq)]`
312 mir_build_unsized_pattern = cannot use unsized non-slice type `{$non_sm_ty}` in constant patterns
314 mir_build_invalid_pattern = `{$non_sm_ty}` cannot be used in patterns
316 mir_build_float_pattern = floating-point types cannot be used in patterns
318 mir_build_pointer_pattern = function pointers and unsized pointers in patterns behave unpredictably and should not be relied upon. See https://github.com/rust-lang/rust/issues/70861 for details.
320 mir_build_indirect_structural_match =
321 to use a constant of type `{$non_sm_ty}` in a pattern, `{$non_sm_ty}` must be annotated with `#[derive(PartialEq, Eq)]`
323 mir_build_nontrivial_structural_match =
324 to use a constant of type `{$non_sm_ty}` in a pattern, the constant's initializer must be trivial or `{$non_sm_ty}` must be annotated with `#[derive(PartialEq, Eq)]`
326 mir_build_overlapping_range_endpoints = multiple patterns overlap on their endpoints
327 .range = ... with this range
328 .note = you likely meant to write mutually exclusive ranges
330 mir_build_non_exhaustive_omitted_pattern = some variants are not matched explicitly
331 .help = ensure that all variants are matched explicitly by adding the suggested match arms
332 .note = the matched value is of type `{$scrut_ty}` and the `non_exhaustive_omitted_patterns` attribute was found
334 mir_build_uncovered = {$count ->
335 [1] pattern `{$witness_1}`
336 [2] patterns `{$witness_1}` and `{$witness_2}`
337 [3] patterns `{$witness_1}`, `{$witness_2}` and `{$witness_3}`
338 *[other] patterns `{$witness_1}`, `{$witness_2}`, `{$witness_3}` and {$remainder} more
341 mir_build_pattern_not_covered = refutable pattern in {$origin}
342 .pattern_ty = the matched value is of type `{$pattern_ty}`
344 mir_build_inform_irrefutable = `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
346 mir_build_more_information = for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
348 mir_build_res_defined_here = {$res} defined here
350 mir_build_adt_defined_here = `{$ty}` defined here
352 mir_build_variant_defined_here = not covered
354 mir_build_interpreted_as_const = introduce a variable instead
356 mir_build_confused = missing patterns are not covered because `{$variable}` is interpreted as {$article} {$res} pattern, not a new variable
358 mir_build_suggest_if_let = you might want to use `if let` to ignore the {$count ->
359 [one] variant that isn't
360 *[other] variants that aren't
363 mir_build_suggest_let_else = you might want to use `let else` to handle the {$count ->
364 [one] variant that isn't
365 *[other] variants that aren't