]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_error_messages/locales/en-US/mir_build.ftl
Unify Opaque/Projection handling in region outlives code
[rust.git] / compiler / rustc_error_messages / locales / en-US / mir_build.ftl
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
4
5 mir_build_unconditional_recursion_call_site_label = recursive call site
6
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
11
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
16
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
21
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
24     block (error E0133)
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
27
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
32
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
37
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
42
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
47
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
52
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
57
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]`
62
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
67
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
72
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
77
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
82
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
87
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
92
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
97
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
102
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
107
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
112
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
117
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
122
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
127
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
132
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
137
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
142
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
147
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
152
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
157
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
162
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]`
167
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]`
172
173 mir_build_unused_unsafe = unnecessary `unsafe` block
174     .label = unnecessary `unsafe` block
175
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
178
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
186
187 mir_build_static_in_pattern = statics cannot be referenced in patterns
188
189 mir_build_assoc_const_in_pattern = associated consts cannot be referenced in patterns
190
191 mir_build_const_param_in_pattern = const parameters cannot be referenced in patterns
192
193 mir_build_non_const_path = runtime values cannot be referenced in patterns
194
195 mir_build_unreachable_pattern = unreachable pattern
196     .label = unreachable pattern
197     .catchall_label = matches any value
198
199 mir_build_const_pattern_depends_on_generic_parameter =
200     constant pattern depends on a generic parameter
201
202 mir_build_could_not_eval_const_pattern = could not evaluate constant pattern
203
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.
208
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}`
212
213 mir_build_lower_range_bound_must_be_less_than_upper = lower range bound must be less than upper
214
215 mir_build_leading_irrefutable_let_patterns = leading irrefutable {$count ->
216         [one] pattern
217         *[other] patterns
218     } in let chain
219     .note = {$count ->
220         [one] this pattern
221         *[other] these patterns
222     } will always match
223     .help = consider moving {$count ->
224         [one] it
225         *[other] them
226     } outside of the construct
227
228 mir_build_trailing_irrefutable_let_patterns = trailing irrefutable {$count ->
229         [one] pattern
230         *[other] patterns
231     } in let chain
232     .note = {$count ->
233         [one] this pattern
234         *[other] these patterns
235     } will always match
236     .help = consider moving {$count ->
237         [one] it
238         *[other] them
239     } into the body
240
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
244
245 mir_build_irrefutable_let_patterns_generic_let = irrefutable `let` {$count ->
246         [one] pattern
247         *[other] patterns
248     }
249     .note = {$count ->
250         [one] this pattern
251         *[other] these patterns
252     } will always match, so the `let` is useless
253     .help = consider removing `let`
254
255 mir_build_irrefutable_let_patterns_if_let = irrefutable `if let` {$count ->
256         [one] pattern
257         *[other] patterns
258     }
259     .note = {$count ->
260         [one] this pattern
261         *[other] these patterns
262     } will always match, so the `if let` is useless
263     .help = consider replacing the `if let` with a `let`
264
265 mir_build_irrefutable_let_patterns_if_let_guard = irrefutable `if let` guard {$count ->
266         [one] pattern
267         *[other] patterns
268     }
269     .note = {$count ->
270         [one] this pattern
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
274
275 mir_build_irrefutable_let_patterns_let_else = irrefutable `let...else` {$count ->
276         [one] pattern
277         *[other] patterns
278     }
279     .note = {$count ->
280         [one] this pattern
281         *[other] these patterns
282     } will always match, so the `else` clause is useless
283     .help = consider removing the `else` clause
284
285 mir_build_irrefutable_let_patterns_while_let = irrefutable `while let` {$count ->
286         [one] pattern
287         *[other] patterns
288     }
289     .note = {$count ->
290         [one] this pattern
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
294
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
300
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
306
307 mir_build_union_pattern = cannot use unions in constant patterns
308
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)]`
311
312 mir_build_unsized_pattern = cannot use unsized non-slice type `{$non_sm_ty}` in constant patterns
313
314 mir_build_invalid_pattern = `{$non_sm_ty}` cannot be used in patterns
315
316 mir_build_float_pattern = floating-point types cannot be used in patterns
317
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.
319
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)]`
322
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)]`
325
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
329
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
333
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
339     } not covered
340
341 mir_build_pattern_not_covered = refutable pattern in {$origin}
342     .pattern_ty = the matched value is of type `{$pattern_ty}`
343
344 mir_build_inform_irrefutable = `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
345
346 mir_build_more_information = for more information, visit https://doc.rust-lang.org/book/ch18-02-refutability.html
347
348 mir_build_res_defined_here = {$res} defined here
349
350 mir_build_adt_defined_here = `{$ty}` defined here
351
352 mir_build_variant_defined_here = not covered
353
354 mir_build_interpreted_as_const = introduce a variable instead
355
356 mir_build_confused = missing patterns are not covered because `{$variable}` is interpreted as {$article} {$res} pattern, not a new variable
357
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
361     } matched
362
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
366     } matched