1 -passes_previously_accepted =
2 this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
5 see issue #{$issue} <https://github.com/rust-lang/rust/issues/{$issue}> for more information
7 passes_incorrect_do_not_recommend_location =
8 `#[do_not_recommend]` can only be placed on trait implementations
10 passes_outer_crate_level_attr =
11 crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
13 passes_inner_crate_level_attr =
14 crate-level attribute should be in the root module
16 passes_ignored_attr_with_macro =
17 `#[{$sym}]` is ignored on struct fields, match arms and macro defs
18 .warn = {-passes_previously_accepted}
19 .note = {-passes_see_issue(issue: "80564")}
22 `#[{$sym}]` is ignored on struct fields and match arms
23 .warn = {-passes_previously_accepted}
24 .note = {-passes_see_issue(issue: "80564")}
26 passes_inline_ignored_function_prototype =
27 `#[inline]` is ignored on function prototypes
29 passes_inline_ignored_constants =
30 `#[inline]` is ignored on constants
31 .warn = {-passes_previously_accepted}
32 .note = {-passes_see_issue(issue: "65833")}
34 passes_inline_not_fn_or_closure =
35 attribute should be applied to function or closure
36 .label = not a function or closure
38 passes_no_coverage_ignored_function_prototype =
39 `#[no_coverage]` is ignored on function prototypes
41 passes_no_coverage_propagate =
42 `#[no_coverage]` does not propagate into items and must be applied to the contained functions directly
44 passes_no_coverage_fn_defn =
45 `#[no_coverage]` may only be applied to function definitions
47 passes_no_coverage_not_coverable =
48 `#[no_coverage]` must be applied to coverable code
49 .label = not coverable code
51 passes_should_be_applied_to_fn =
52 attribute should be applied to a function definition
53 .label = {$on_crate ->
54 [true] cannot be applied to crates
55 *[false] not a function definition
58 passes_naked_tracked_caller =
59 cannot use `#[track_caller]` with `#[naked]`
61 passes_should_be_applied_to_struct_enum =
62 attribute should be applied to a struct or enum
63 .label = not a struct or enum
65 passes_should_be_applied_to_trait =
66 attribute should be applied to a trait
69 passes_target_feature_on_statement =
70 {passes_should_be_applied_to_fn}
71 .warn = {-passes_previously_accepted}
72 .label = {passes_should_be_applied_to_fn.label}
74 passes_should_be_applied_to_static =
75 attribute should be applied to a static
78 passes_doc_expect_str =
79 doc {$attr_name} attribute expects a string: #[doc({$attr_name} = "a")]
81 passes_doc_alias_empty =
82 {$attr_str} attribute cannot have empty value
84 passes_doc_alias_bad_char =
85 {$char_} character isn't allowed in {$attr_str}
87 passes_doc_alias_start_end =
88 {$attr_str} cannot start or end with ' '
90 passes_doc_alias_bad_location =
91 {$attr_str} isn't allowed on {$location}
93 passes_doc_alias_not_an_alias =
94 {$attr_str} is the same as the item's name
96 passes_doc_alias_duplicated = doc alias is duplicated
97 .label = first defined here
99 passes_doc_alias_not_string_literal =
100 `#[doc(alias("a"))]` expects string literals
102 passes_doc_alias_malformed =
103 doc alias attribute expects a string `#[doc(alias = "a")]` or a list of strings `#[doc(alias("a", "b"))]`
105 passes_doc_keyword_empty_mod =
106 `#[doc(keyword = "...")]` should be used on empty modules
108 passes_doc_keyword_not_mod =
109 `#[doc(keyword = "...")]` should be used on modules
111 passes_doc_keyword_invalid_ident =
112 `{$doc_keyword}` is not a valid identifier
114 passes_doc_fake_variadic_not_valid =
115 `#[doc(fake_variadic)]` must be used on the first of a set of tuple or fn pointer trait impls with varying arity
117 passes_doc_keyword_only_impl =
118 `#[doc(keyword = "...")]` should be used on impl blocks
120 passes_doc_inline_conflict_first =
123 passes_doc_inline_conflict_second =
124 {"."}..conflicts with this attribute
126 passes_doc_inline_conflict =
127 conflicting doc inlining attributes
128 .help = remove one of the conflicting attributes
130 passes_doc_inline_only_use =
131 this attribute can only be applied to a `use` item
132 .label = only applicable on `use` items
133 .not_a_use_item_label = not a `use` item
134 .note = read <https://doc.rust-lang.org/nightly/rustdoc/the-doc-attribute.html#inline-and-no_inline> for more information
136 passes_doc_attr_not_crate_level =
137 `#![doc({$attr_name} = "...")]` isn't allowed as a crate-level attribute
139 passes_attr_crate_level =
140 this attribute can only be applied at the crate level
141 .suggestion = to apply to the crate, use an inner attribute
142 .help = to apply to the crate, use an inner attribute
143 .note = read <https://doc.rust-lang.org/nightly/rustdoc/the-doc-attribute.html#at-the-crate-level> for more information
145 passes_doc_test_unknown =
146 unknown `doc(test)` attribute `{$path}`
148 passes_doc_test_takes_list =
149 `#[doc(test(...)]` takes a list of attributes
151 passes_doc_primitive =
152 `doc(primitive)` should never have been stable
154 passes_doc_cfg_hide_takes_list =
155 `#[doc(cfg_hide(...)]` takes a list of attributes
157 passes_doc_test_unknown_any =
158 unknown `doc` attribute `{$path}`
160 passes_doc_test_unknown_spotlight =
161 unknown `doc` attribute `{$path}`
162 .note = `doc(spotlight)` was renamed to `doc(notable_trait)`
163 .suggestion = use `notable_trait` instead
164 .no_op_note = `doc(spotlight)` is now a no-op
166 passes_doc_test_unknown_include =
167 unknown `doc` attribute `{$path}`
168 .suggestion = use `doc = include_str!` instead
171 invalid `doc` attribute
173 passes_pass_by_value =
174 `pass_by_value` attribute should be applied to a struct, enum or type alias
175 .label = is not a struct, enum or type alias
177 passes_allow_incoherent_impl =
178 `rustc_allow_incoherent_impl` attribute should be applied to impl items.
179 .label = the only currently supported targets are inherent methods
181 passes_has_incoherent_inherent_impl =
182 `rustc_has_incoherent_inherent_impls` attribute should be applied to types or traits.
183 .label = only adts, extern types and traits are supported
185 passes_both_ffi_const_and_pure =
186 `#[ffi_const]` function cannot be `#[ffi_pure]`
188 passes_ffi_pure_invalid_target =
189 `#[ffi_pure]` may only be used on foreign functions
191 passes_ffi_const_invalid_target =
192 `#[ffi_const]` may only be used on foreign functions
194 passes_ffi_returns_twice_invalid_target =
195 `#[ffi_returns_twice]` may only be used on foreign functions
197 passes_must_use_async =
198 `must_use` attribute on `async` functions applies to the anonymous `Future` returned by the function, not the value within
199 .label = this attribute does nothing, the `Future`s returned by async functions are already `must_use`
201 passes_must_use_no_effect =
202 `#[must_use]` has no effect when applied to {$article} {$target}
204 passes_must_not_suspend =
205 `must_not_suspend` attribute should be applied to a struct, enum, or trait
206 .label = is not a struct, enum, or trait
209 {passes_should_be_applied_to_fn}
210 .warn = {-passes_previously_accepted}
211 .label = {passes_should_be_applied_to_fn.label}
214 attribute should be applied to an `extern` block with non-Rust ABI
215 .warn = {-passes_previously_accepted}
216 .label = not an `extern` block
219 attribute should be applied to a foreign function or static
220 .warn = {-passes_previously_accepted}
221 .label = not a foreign function or static
222 .help = try `#[link(name = "{$value}")]` instead
225 attribute should be applied to an `extern crate` item
226 .label = not an `extern crate` item
229 attribute should be applied to a free function, impl method or static
230 .label = not a free function, impl method or static
232 passes_rustc_layout_scalar_valid_range_not_struct =
233 attribute should be applied to a struct
234 .label = not a struct
236 passes_rustc_layout_scalar_valid_range_arg =
237 expected exactly one integer literal argument
239 passes_rustc_legacy_const_generics_only =
240 #[rustc_legacy_const_generics] functions must only have const generics
241 .label = non-const generic parameter
243 passes_rustc_legacy_const_generics_index =
244 #[rustc_legacy_const_generics] must have one index for each generic parameter
245 .label = generic parameters
247 passes_rustc_legacy_const_generics_index_exceed =
248 index exceeds number of arguments
249 .label = there {$arg_count ->
252 } only {$arg_count} {$arg_count ->
257 passes_rustc_legacy_const_generics_index_negative =
258 arguments should be non-negative integers
260 passes_rustc_dirty_clean =
261 attribute requires -Z query-dep-graph to be enabled
263 passes_link_section =
264 attribute should be applied to a function or static
265 .warn = {-passes_previously_accepted}
266 .label = not a function or static
268 passes_no_mangle_foreign =
269 `#[no_mangle]` has no effect on a foreign {$foreign_item_kind}
270 .warn = {-passes_previously_accepted}
271 .label = foreign {$foreign_item_kind}
272 .note = symbol names in extern blocks are not mangled
273 .suggestion = remove this attribute
276 attribute should be applied to a free function, impl method or static
277 .warn = {-passes_previously_accepted}
278 .label = not a free function, impl method or static
281 meta item in `repr` must be an identifier
283 passes_repr_conflicting =
284 conflicting representation hints
287 attribute must be applied to a `static` variable
289 passes_used_compiler_linker =
290 `used(compiler)` and `used(linker)` can't be used together
292 passes_allow_internal_unstable =
293 attribute should be applied to a macro
296 passes_debug_visualizer_placement =
297 attribute should be applied to a module
299 passes_debug_visualizer_invalid =
301 .note_1 = expected: `natvis_file = "..."`
303 .note_3 = expected: `gdb_script_file = "..."`
305 passes_debug_visualizer_unreadable =
306 couldn't read {$file}: {$error}
308 passes_rustc_allow_const_fn_unstable =
309 attribute should be applied to `const fn`
310 .label = not a `const fn`
312 passes_rustc_std_internal_symbol =
313 attribute should be applied to functions or statics
314 .label = not a function or static
317 attribute should be applied to a trait
319 passes_stability_promotable =
320 attribute cannot be applied to an expression
323 attribute is ignored here
326 `#[{$name}]` only has an effect on `extern crate` and modules
328 passes_macro_export =
329 `#[macro_export]` only has an effect on macro definitions
331 passes_plugin_registrar =
332 `#[plugin_registrar]` only has an effect on functions
334 passes_unused_empty_lints_note =
335 attribute `{$name}` with an empty list has no effect
337 passes_unused_no_lints_note =
338 attribute `{$name}` without any lints has no effect
340 passes_unused_default_method_body_const_note =
341 `default_method_body_is_const` has been replaced with `#[const_trait]` on traits
345 .suggestion = remove this attribute
347 passes_non_exported_macro_invalid_attrs =
348 attribute should be applied to function or closure
349 .label = not a function or closure
351 passes_unused_duplicate =
353 .suggestion = remove this attribute
354 .note = attribute also specified here
355 .warn = {-passes_previously_accepted}
357 passes_unused_multiple =
358 multiple `{$name}` attributes
359 .suggestion = remove this attribute
360 .note = attribute also specified here
362 passes_rustc_lint_opt_ty =
363 `#[rustc_lint_opt_ty]` should be applied to a struct
364 .label = not a struct
366 passes_rustc_lint_opt_deny_field_access =
367 `#[rustc_lint_opt_deny_field_access]` should be applied to a field
370 passes_link_ordinal =
371 attribute should be applied to a foreign function or static
372 .label = not a foreign function or static
374 passes_collapse_debuginfo =
375 `collapse_debuginfo` attribute should be applied to macro definitions
376 .label = not a macro definition
378 passes_deprecated_annotation_has_no_effect =
379 this `#[deprecated]` annotation has no effect
380 .suggestion = remove the unnecessary deprecation attribute
382 passes_unknown_external_lang_item =
383 unknown external lang item: `{$lang_item}`
385 passes_missing_panic_handler =
386 `#[panic_handler]` function required, but not found
388 passes_missing_lang_item =
389 language item required, but not found: `{$name}`
390 .note = this can occur when a binary crate with `#![no_std]` is compiled for a target where `{$name}` is defined in the standard library
391 .help = you may be able to compile for a target that doesn't need `{$name}`, specify a target with `--target` or in `.cargo/config`
393 passes_lang_item_on_incorrect_target =
394 `{$name}` language item must be applied to a {$expected_target}
395 .label = attribute should be applied to a {$expected_target}, not a {$actual_target}
397 passes_unknown_lang_item =
398 definition of an unknown language item: `{$name}`
399 .label = definition of unknown language item `{$name}`
401 passes_invalid_attr_at_crate_level =
402 `{$name}` attribute cannot be used at crate level
403 .suggestion = perhaps you meant to use an outer attribute
405 passes_duplicate_diagnostic_item =
406 duplicate diagnostic item found: `{$name}`.
408 passes_duplicate_diagnostic_item_in_crate =
409 duplicate diagnostic item in crate `{$crate_name}`: `{$name}`.
411 passes_diagnostic_item_first_defined =
412 the diagnostic item is first defined here
413 .note = the diagnostic item is first defined in crate `{$orig_crate_name}`.
424 passes_homogeneous_aggregate =
425 homogeneous_aggregate: {$homogeneous_aggregate}
428 layout_of({$normalized_ty}) = {$ty_layout}
430 passes_unrecognized_field =
431 unrecognized field name `{$name}`
434 layout error: {$layout_error}
436 passes_feature_stable_twice =
437 feature `{$feature}` is declared stable since {$since}, but was previously declared stable since {$prev_since}
439 passes_feature_previously_declared =
440 feature `{$feature}` is declared {$declared}, but was previously declared {$prev_declared}
442 passes_expr_not_allowed_in_context =
443 {$expr} is not allowed in a `{$context}`
445 passes_const_impl_const_trait =
446 const `impl`s must be for traits marked with `#[const_trait]`
447 .note = this trait must be annotated with `#[const_trait]`
449 passes_break_non_loop =
450 `break` with value from a `{$kind}` loop
451 .label = can only break with a value inside `loop` or breakable block
452 .label2 = you can't `break` with a value in a `{$kind}` loop
453 .suggestion = use `break` on its own without a value inside this `{$kind}` loop
454 .break_expr_suggestion = alternatively, you might have meant to use the available loop label
456 passes_continue_labeled_block =
457 `continue` pointing to a labeled block
458 .label = labeled blocks cannot be `continue`'d
459 .block_label = labeled block the `continue` points to
461 passes_break_inside_closure =
462 `{$name}` inside of a closure
463 .label = cannot `{$name}` inside of a closure
464 .closure_label = enclosing closure
466 passes_break_inside_async_block =
467 `{$name}` inside of an `async` block
468 .label = cannot `{$name}` inside of an `async` block
469 .async_block_label = enclosing `async` block
471 passes_outside_loop =
472 `{$name}` outside of a loop{$is_break ->
473 [true] {" or labeled block"}
476 .label = cannot `{$name}` outside of a loop{$is_break ->
477 [true] {" or labeled block"}
481 passes_unlabeled_in_labeled_block =
482 unlabeled `{$cf_type}` inside of a labeled block
483 .label = `{$cf_type}` statements that would diverge to or through a labeled block need to bear a label
485 passes_unlabeled_cf_in_while_condition =
486 `break` or `continue` with no label in the condition of a `while` loop
487 .label = unlabeled `{$cf_type}` in the condition of a `while` loop
489 passes_cannot_inline_naked_function =
490 naked functions cannot be inlined
492 passes_undefined_naked_function_abi =
493 Rust ABI is unsupported in naked functions
496 patterns not allowed in naked function parameters
498 passes_params_not_allowed =
499 referencing function parameters is not allowed in naked functions
500 .help = follow the calling convention in asm block to use parameters
502 passes_naked_functions_asm_block =
503 naked functions must contain a single asm block
504 .label_multiple_asm = multiple asm blocks are unsupported in naked functions
505 .label_non_asm = non-asm is unsupported in naked functions
507 passes_naked_functions_operands =
508 only `const` and `sym` operands are supported in naked functions
510 passes_naked_functions_asm_options =
511 asm options unsupported in naked functions: {$unsupported_options}
513 passes_naked_functions_must_use_noreturn =
514 asm in naked functions must use `noreturn` option
515 .suggestion = consider specifying that the asm block is responsible for returning from the function
517 passes_attr_only_on_main =
518 `{$attr}` attribute can only be used on `fn main()`
520 passes_attr_only_on_root_main =
521 `{$attr}` attribute can only be used on root `fn main()`
523 passes_attr_only_in_functions =
524 `{$attr}` attribute can only be used on functions
526 passes_multiple_rustc_main =
527 multiple functions with a `#[rustc_main]` attribute
528 .first = first `#[rustc_main]` function
529 .additional = additional `#[rustc_main]` function
531 passes_multiple_start_functions =
532 multiple `start` functions
533 .label = multiple `start` functions
534 .previous = previous `#[start]` function here
537 the `main` function cannot be declared in an `extern` block
539 passes_unix_sigpipe_values =
540 valid values for `#[unix_sigpipe = "..."]` are `inherit`, `sig_ign`, or `sig_dfl`
542 passes_no_main_function =
543 `main` function not found in crate `{$crate_name}`
544 .here_is_main = here is a function named `main`
545 .one_or_more_possible_main = you have one or more functions named `main` not defined at the crate level
546 .consider_moving_main = consider moving the `main` function definitions
547 .main_must_be_defined_at_crate = the main function must be defined at the crate level{$has_filename ->
548 [true] {" "}(in `{$filename}`)
551 .consider_adding_main_to_file = consider adding a `main` function to `{$filename}`
552 .consider_adding_main_at_crate = consider adding a `main` function at the crate level
553 .teach_note = If you don't know the basics of Rust, you can go look to the Rust Book to get started: https://doc.rust-lang.org/book/
554 .non_function_main = non-function item at `crate::main` is found
556 passes_duplicate_lang_item =
557 found duplicate lang item `{$lang_item_name}`
558 .first_defined_span = the lang item is first defined here
559 .first_defined_crate_depends = the lang item is first defined in crate `{$orig_crate_name}` (which `{$orig_dependency_of}` depends on)
560 .first_defined_crate = the lang item is first defined in crate `{$orig_crate_name}`.
561 .first_definition_local = first definition in the local crate (`{$orig_crate_name}`)
562 .second_definition_local = second definition in the local crate (`{$crate_name}`)
563 .first_definition_path = first definition in `{$orig_crate_name}` loaded from {$orig_path}
564 .second_definition_path = second definition in `{$crate_name}` loaded from {$path}
566 passes_duplicate_lang_item_crate =
567 duplicate lang item in crate `{$crate_name}`: `{$lang_item_name}`.
568 .first_defined_span = the lang item is first defined here
569 .first_defined_crate_depends = the lang item is first defined in crate `{$orig_crate_name}` (which `{$orig_dependency_of}` depends on)
570 .first_defined_crate = the lang item is first defined in crate `{$orig_crate_name}`.
571 .first_definition_local = first definition in the local crate (`{$orig_crate_name}`)
572 .second_definition_local = second definition in the local crate (`{$crate_name}`)
573 .first_definition_path = first definition in `{$orig_crate_name}` loaded from {$orig_path}
574 .second_definition_path = second definition in `{$crate_name}` loaded from {$path}
576 passes_duplicate_lang_item_crate_depends =
577 duplicate lang item in crate `{$crate_name}` (which `{$dependency_of}` depends on): `{$lang_item_name}`.
578 .first_defined_span = the lang item is first defined here
579 .first_defined_crate_depends = the lang item is first defined in crate `{$orig_crate_name}` (which `{$orig_dependency_of}` depends on)
580 .first_defined_crate = the lang item is first defined in crate `{$orig_crate_name}`.
581 .first_definition_local = first definition in the local crate (`{$orig_crate_name}`)
582 .second_definition_local = second definition in the local crate (`{$crate_name}`)
583 .first_definition_path = first definition in `{$orig_crate_name}` loaded from {$orig_path}
584 .second_definition_path = second definition in `{$crate_name}` loaded from {$path}
586 passes_incorrect_target =
587 `{$name}` language item must be applied to a {$kind} with {$at_least ->
588 [true] at least {$num}
594 .label = this {$kind} has {$actual_num} generic {$actual_num ->
599 passes_useless_assignment =
600 useless assignment of {$is_field_assign ->
603 } of type `{$ty}` to itself
605 passes_only_has_effect_on =
606 `#[{$attr_name}]` only has an effect on {$target_name ->
609 [implementation_block] implementation blocks
610 *[unspecified] (unspecified--this is a compiler bug)
613 passes_object_lifetime_err =
616 passes_unrecognized_repr_hint =
617 unrecognized representation hint
618 .help = valid reprs are `C`, `align`, `packed`, `transparent`, `simd`, `i8`, `u8`, `i16`, `u16`, `i32`, `u32`, `i64`, `u64`, `i128`, `u128`, `isize`, `usize`
620 passes_attr_application_enum =
621 attribute should be applied to an enum
624 passes_attr_application_struct =
625 attribute should be applied to a struct
626 .label = not a struct
628 passes_attr_application_struct_union =
629 attribute should be applied to a struct or union
630 .label = not a struct or union
632 passes_attr_application_struct_enum_union =
633 attribute should be applied to a struct, enum, or union
634 .label = not a struct, enum, or union
636 passes_attr_application_struct_enum_function_union =
637 attribute should be applied to a struct, enum, function, or union
638 .label = not a struct, enum, function, or union
640 passes_transparent_incompatible =
641 transparent {$target} cannot have other repr hints
643 passes_deprecated_attribute =
644 deprecated attribute must be paired with either stable or unstable attribute
646 passes_useless_stability =
647 this stability annotation is useless
648 .label = useless stability annotation
649 .item = the stability attribute annotates this item
651 passes_invalid_stability =
652 invalid stability version found
653 .label = invalid stability version
654 .item = the stability attribute annotates this item
656 passes_cannot_stabilize_deprecated =
657 an API can't be stabilized after it is deprecated
658 .label = invalid version
659 .item = the stability attribute annotates this item
661 passes_invalid_deprecation_version =
662 invalid deprecation version found
663 .label = invalid deprecation version
664 .item = the stability attribute annotates this item
666 passes_missing_stability_attr =
667 {$descr} has missing stability attribute
669 passes_missing_const_stab_attr =
670 {$descr} has missing const stability attribute
672 passes_trait_impl_const_stable =
673 trait implementations cannot be const stable yet
674 .note = see issue #67792 <https://github.com/rust-lang/rust/issues/67792> for more information
676 passes_feature_only_on_nightly =
677 `#![feature]` may not be used on the {$release_channel} release channel
679 passes_unknown_feature =
680 unknown feature `{$feature}`
682 passes_implied_feature_not_exist =
683 feature `{$implied_by}` implying `{$feature}` does not exist
685 passes_duplicate_feature_err =
686 the feature `{$feature}` has already been declared
688 passes_missing_const_err =
689 attributes `#[rustc_const_unstable]` and `#[rustc_const_stable]` require the function or method to be `const`
690 .help = make the function or method const
691 .label = attribute specified here
695 *[true] multiple {$descr}s are
697 [one] {$descr} {$name_list} is
698 *[other] {$descr}s {$name_list} are
700 } never {$participle}
702 passes_change_fields_to_be_of_unit_type =
703 consider changing the { $num ->
706 } to be of unit type to suppress this warning while preserving the field numbering, or remove the { $num ->
715 } in this {$parent_descr}
717 passes_ignored_derived_impls =
718 `{$name}` has {$trait_list_len ->
720 *[other] derived impls
721 } for the {$trait_list_len ->
722 [one] trait {$trait_list}, but this is
723 *[other] traits {$trait_list}, but these are
724 } intentionally ignored during dead code analysis
726 passes_proc_macro_typeerror = mismatched {$kind} signature
727 .label = found {$found}, expected type `proc_macro::TokenStream`
728 .note = {$kind}s must have a signature of `{$expected_signature}`
730 passes_proc_macro_diff_arg_count = mismatched {$kind} signature
731 .label = found unexpected {$count ->
735 .note = {$kind}s must have a signature of `{$expected_signature}`
737 passes_proc_macro_missing_args = mismatched {$kind} signature
738 .label = {$kind} must have {$expected_input_count ->
740 *[other] two arguments
741 } of type `proc_macro::TokenStream`
743 passes_proc_macro_invalid_abi = proc macro functions may not be `extern "{$abi}"`
745 passes_proc_macro_unsafe = proc macro functions may not be `unsafe`
747 passes_skipping_const_checks = skipping const checks