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_outer_crate_level_attr =
8 crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
10 passes_inner_crate_level_attr =
11 crate-level attribute should be in the root module
13 passes_ignored_attr_with_macro =
14 `#[{$sym}]` is ignored on struct fields, match arms and macro defs
15 .warn = {-passes_previously_accepted}
16 .note = {-passes_see_issue(issue: "80564")}
19 `#[{$sym}]` is ignored on struct fields and match arms
20 .warn = {-passes_previously_accepted}
21 .note = {-passes_see_issue(issue: "80564")}
23 passes_inline_ignored_function_prototype =
24 `#[inline]` is ignored on function prototypes
26 passes_inline_ignored_constants =
27 `#[inline]` is ignored on constants
28 .warn = {-passes_previously_accepted}
29 .note = {-passes_see_issue(issue: "65833")}
31 passes_inline_not_fn_or_closure =
32 attribute should be applied to function or closure
33 .label = not a function or closure
35 passes_no_coverage_ignored_function_prototype =
36 `#[no_coverage]` is ignored on function prototypes
38 passes_no_coverage_propagate =
39 `#[no_coverage]` does not propagate into items and must be applied to the contained functions directly
41 passes_no_coverage_fn_defn =
42 `#[no_coverage]` may only be applied to function definitions
44 passes_no_coverage_not_coverable =
45 `#[no_coverage]` must be applied to coverable code
46 .label = not coverable code
48 passes_should_be_applied_to_fn =
49 attribute should be applied to a function definition
50 .label = {$on_crate ->
51 [true] cannot be applied to crates
52 *[false] not a function definition
55 passes_naked_tracked_caller =
56 cannot use `#[track_caller]` with `#[naked]`
58 passes_should_be_applied_to_struct_enum =
59 attribute should be applied to a struct or enum
60 .label = not a struct or enum
62 passes_should_be_applied_to_trait =
63 attribute should be applied to a trait
66 passes_target_feature_on_statement =
67 {passes_should_be_applied_to_fn}
68 .warn = {-passes_previously_accepted}
69 .label = {passes_should_be_applied_to_fn.label}
71 passes_should_be_applied_to_static =
72 attribute should be applied to a static
75 passes_doc_expect_str =
76 doc {$attr_name} attribute expects a string: #[doc({$attr_name} = "a")]
78 passes_doc_alias_empty =
79 {$attr_str} attribute cannot have empty value
81 passes_doc_alias_bad_char =
82 {$char_} character isn't allowed in {$attr_str}
84 passes_doc_alias_start_end =
85 {$attr_str} cannot start or end with ' '
87 passes_doc_alias_bad_location =
88 {$attr_str} isn't allowed on {$location}
90 passes_doc_alias_not_an_alias =
91 {$attr_str} is the same as the item's name
93 passes_doc_alias_duplicated = doc alias is duplicated
94 .label = first defined here
96 passes_doc_alias_not_string_literal =
97 `#[doc(alias("a"))]` expects string literals
99 passes_doc_alias_malformed =
100 doc alias attribute expects a string `#[doc(alias = "a")]` or a list of strings `#[doc(alias("a", "b"))]`
102 passes_doc_keyword_empty_mod =
103 `#[doc(keyword = "...")]` should be used on empty modules
105 passes_doc_keyword_not_mod =
106 `#[doc(keyword = "...")]` should be used on modules
108 passes_doc_keyword_invalid_ident =
109 `{$doc_keyword}` is not a valid identifier
111 passes_doc_fake_variadic_not_valid =
112 `#[doc(fake_variadic)]` must be used on the first of a set of tuple or fn pointer trait impls with varying arity
114 passes_doc_keyword_only_impl =
115 `#[doc(keyword = "...")]` should be used on impl blocks
117 passes_doc_inline_conflict_first =
120 passes_doc_inline_conflict_second =
121 {"."}..conflicts with this attribute
123 passes_doc_inline_conflict =
124 conflicting doc inlining attributes
125 .help = remove one of the conflicting attributes
127 passes_doc_inline_only_use =
128 this attribute can only be applied to a `use` item
129 .label = only applicable on `use` items
130 .not_a_use_item_label = not a `use` item
131 .note = read <https://doc.rust-lang.org/nightly/rustdoc/the-doc-attribute.html#inline-and-no_inline> for more information
133 passes_doc_attr_not_crate_level =
134 `#![doc({$attr_name} = "...")]` isn't allowed as a crate-level attribute
136 passes_attr_crate_level =
137 this attribute can only be applied at the crate level
138 .suggestion = to apply to the crate, use an inner attribute
139 .help = to apply to the crate, use an inner attribute
140 .note = read <https://doc.rust-lang.org/nightly/rustdoc/the-doc-attribute.html#at-the-crate-level> for more information
142 passes_doc_test_unknown =
143 unknown `doc(test)` attribute `{$path}`
145 passes_doc_test_takes_list =
146 `#[doc(test(...)]` takes a list of attributes
148 passes_doc_primitive =
149 `doc(primitive)` should never have been stable
151 passes_doc_cfg_hide_takes_list =
152 `#[doc(cfg_hide(...)]` takes a list of attributes
154 passes_doc_test_unknown_any =
155 unknown `doc` attribute `{$path}`
157 passes_doc_test_unknown_spotlight =
158 unknown `doc` attribute `{$path}`
159 .note = `doc(spotlight)` was renamed to `doc(notable_trait)`
160 .suggestion = use `notable_trait` instead
161 .no_op_note = `doc(spotlight)` is now a no-op
163 passes_doc_test_unknown_include =
164 unknown `doc` attribute `{$path}`
165 .suggestion = use `doc = include_str!` instead
168 invalid `doc` attribute
170 passes_pass_by_value =
171 `pass_by_value` attribute should be applied to a struct, enum or type alias
172 .label = is not a struct, enum or type alias
174 passes_allow_incoherent_impl =
175 `rustc_allow_incoherent_impl` attribute should be applied to impl items.
176 .label = the only currently supported targets are inherent methods
178 passes_has_incoherent_inherent_impl =
179 `rustc_has_incoherent_inherent_impls` attribute should be applied to types or traits.
180 .label = only adts, extern types and traits are supported
182 passes_must_use_async =
183 `must_use` attribute on `async` functions applies to the anonymous `Future` returned by the function, not the value within
184 .label = this attribute does nothing, the `Future`s returned by async functions are already `must_use`
186 passes_must_use_no_effect =
187 `#[must_use]` has no effect when applied to {$article} {$target}
189 passes_must_not_suspend =
190 `must_not_suspend` attribute should be applied to a struct, enum, or trait
191 .label = is not a struct, enum, or trait
194 {passes_should_be_applied_to_fn}
195 .warn = {-passes_previously_accepted}
196 .label = {passes_should_be_applied_to_fn.label}
199 attribute should be applied to an `extern` block with non-Rust ABI
200 .warn = {-passes_previously_accepted}
201 .label = not an `extern` block
204 attribute should be applied to a foreign function or static
205 .warn = {-passes_previously_accepted}
206 .label = not a foreign function or static
207 .help = try `#[link(name = "{$value}")]` instead
210 attribute should be applied to an `extern crate` item
211 .label = not an `extern crate` item
214 attribute should be applied to a free function, impl method or static
215 .label = not a free function, impl method or static
217 passes_rustc_layout_scalar_valid_range_not_struct =
218 attribute should be applied to a struct
219 .label = not a struct
221 passes_rustc_layout_scalar_valid_range_arg =
222 expected exactly one integer literal argument
224 passes_rustc_legacy_const_generics_only =
225 #[rustc_legacy_const_generics] functions must only have const generics
226 .label = non-const generic parameter
228 passes_rustc_legacy_const_generics_index =
229 #[rustc_legacy_const_generics] must have one index for each generic parameter
230 .label = generic parameters
232 passes_rustc_legacy_const_generics_index_exceed =
233 index exceeds number of arguments
234 .label = there {$arg_count ->
237 } only {$arg_count} {$arg_count ->
242 passes_rustc_legacy_const_generics_index_negative =
243 arguments should be non-negative integers
245 passes_rustc_dirty_clean =
246 attribute requires -Z query-dep-graph to be enabled
248 passes_link_section =
249 attribute should be applied to a function or static
250 .warn = {-passes_previously_accepted}
251 .label = not a function or static
253 passes_no_mangle_foreign =
254 `#[no_mangle]` has no effect on a foreign {$foreign_item_kind}
255 .warn = {-passes_previously_accepted}
256 .label = foreign {$foreign_item_kind}
257 .note = symbol names in extern blocks are not mangled
258 .suggestion = remove this attribute
261 attribute should be applied to a free function, impl method or static
262 .warn = {-passes_previously_accepted}
263 .label = not a free function, impl method or static
266 meta item in `repr` must be an identifier
268 passes_repr_conflicting =
269 conflicting representation hints
272 attribute must be applied to a `static` variable
274 passes_used_compiler_linker =
275 `used(compiler)` and `used(linker)` can't be used together
277 passes_allow_internal_unstable =
278 attribute should be applied to a macro
281 passes_debug_visualizer_placement =
282 attribute should be applied to a module
284 passes_debug_visualizer_invalid =
286 .note_1 = expected: `natvis_file = "..."`
288 .note_3 = expected: `gdb_script_file = "..."`
290 passes_debug_visualizer_unreadable =
291 couldn't read {$file}: {$error}
293 passes_rustc_allow_const_fn_unstable =
294 attribute should be applied to `const fn`
295 .label = not a `const fn`
297 passes_rustc_std_internal_symbol =
298 attribute should be applied to functions or statics
299 .label = not a function or static
302 attribute should be applied to a trait
304 passes_stability_promotable =
305 attribute cannot be applied to an expression
308 attribute is ignored here
311 `#[{$name}]` only has an effect on `extern crate` and modules
313 passes_macro_export =
314 `#[macro_export]` only has an effect on macro definitions
316 passes_plugin_registrar =
317 `#[plugin_registrar]` only has an effect on functions
319 passes_unused_empty_lints_note =
320 attribute `{$name}` with an empty list has no effect
322 passes_unused_no_lints_note =
323 attribute `{$name}` without any lints has no effect
325 passes_unused_default_method_body_const_note =
326 `default_method_body_is_const` has been replaced with `#[const_trait]` on traits
330 .suggestion = remove this attribute
332 passes_non_exported_macro_invalid_attrs =
333 attribute should be applied to function or closure
334 .label = not a function or closure
336 passes_unused_duplicate =
338 .suggestion = remove this attribute
339 .note = attribute also specified here
340 .warn = {-passes_previously_accepted}
342 passes_unused_multiple =
343 multiple `{$name}` attributes
344 .suggestion = remove this attribute
345 .note = attribute also specified here
347 passes_rustc_lint_opt_ty =
348 `#[rustc_lint_opt_ty]` should be applied to a struct
349 .label = not a struct
351 passes_rustc_lint_opt_deny_field_access =
352 `#[rustc_lint_opt_deny_field_access]` should be applied to a field
355 passes_link_ordinal =
356 attribute should be applied to a foreign function or static
357 .label = not a foreign function or static
359 passes_collapse_debuginfo =
360 `collapse_debuginfo` attribute should be applied to macro definitions
361 .label = not a macro definition
363 passes_deprecated_annotation_has_no_effect =
364 this `#[deprecated]` annotation has no effect
365 .suggestion = remove the unnecessary deprecation attribute
367 passes_unknown_external_lang_item =
368 unknown external lang item: `{$lang_item}`
370 passes_missing_panic_handler =
371 `#[panic_handler]` function required, but not found
373 passes_missing_lang_item =
374 language item required, but not found: `{$name}`
375 .note = this can occur when a binary crate with `#![no_std]` is compiled for a target where `{$name}` is defined in the standard library
376 .help = you may be able to compile for a target that doesn't need `{$name}`, specify a target with `--target` or in `.cargo/config`
378 passes_lang_item_on_incorrect_target =
379 `{$name}` language item must be applied to a {$expected_target}
380 .label = attribute should be applied to a {$expected_target}, not a {$actual_target}
382 passes_unknown_lang_item =
383 definition of an unknown language item: `{$name}`
384 .label = definition of unknown language item `{$name}`
386 passes_invalid_attr_at_crate_level =
387 `{$name}` attribute cannot be used at crate level
388 .suggestion = perhaps you meant to use an outer attribute
390 passes_duplicate_diagnostic_item =
391 duplicate diagnostic item found: `{$name}`.
393 passes_duplicate_diagnostic_item_in_crate =
394 duplicate diagnostic item in crate `{$crate_name}`: `{$name}`.
396 passes_diagnostic_item_first_defined =
397 the diagnostic item is first defined here
398 .note = the diagnostic item is first defined in crate `{$orig_crate_name}`.
409 passes_homogeneous_aggregate =
410 homogeneous_aggregate: {$homogeneous_aggregate}
413 layout_of({$normalized_ty}) = {$ty_layout}
415 passes_unrecognized_field =
416 unrecognized field name `{$name}`
419 layout error: {$layout_error}
421 passes_feature_stable_twice =
422 feature `{$feature}` is declared stable since {$since}, but was previously declared stable since {$prev_since}
424 passes_feature_previously_declared =
425 feature `{$feature}` is declared {$declared}, but was previously declared {$prev_declared}
427 passes_expr_not_allowed_in_context =
428 {$expr} is not allowed in a `{$context}`
430 passes_const_impl_const_trait =
431 const `impl`s must be for traits marked with `#[const_trait]`
432 .note = this trait must be annotated with `#[const_trait]`
434 passes_break_non_loop =
435 `break` with value from a `{$kind}` loop
436 .label = can only break with a value inside `loop` or breakable block
437 .label2 = you can't `break` with a value in a `{$kind}` loop
438 .suggestion = use `break` on its own without a value inside this `{$kind}` loop
439 .break_expr_suggestion = alternatively, you might have meant to use the available loop label
441 passes_continue_labeled_block =
442 `continue` pointing to a labeled block
443 .label = labeled blocks cannot be `continue`'d
444 .block_label = labeled block the `continue` points to
446 passes_break_inside_closure =
447 `{$name}` inside of a closure
448 .label = cannot `{$name}` inside of a closure
449 .closure_label = enclosing closure
451 passes_break_inside_async_block =
452 `{$name}` inside of an `async` block
453 .label = cannot `{$name}` inside of an `async` block
454 .async_block_label = enclosing `async` block
456 passes_outside_loop =
457 `{$name}` outside of a loop{$is_break ->
458 [true] {" or labeled block"}
461 .label = cannot `{$name}` outside of a loop{$is_break ->
462 [true] {" or labeled block"}
466 passes_unlabeled_in_labeled_block =
467 unlabeled `{$cf_type}` inside of a labeled block
468 .label = `{$cf_type}` statements that would diverge to or through a labeled block need to bear a label
470 passes_unlabeled_cf_in_while_condition =
471 `break` or `continue` with no label in the condition of a `while` loop
472 .label = unlabeled `{$cf_type}` in the condition of a `while` loop
474 passes_cannot_inline_naked_function =
475 naked functions cannot be inlined
477 passes_undefined_naked_function_abi =
478 Rust ABI is unsupported in naked functions
481 patterns not allowed in naked function parameters
483 passes_params_not_allowed =
484 referencing function parameters is not allowed in naked functions
485 .help = follow the calling convention in asm block to use parameters
487 passes_naked_functions_asm_block =
488 naked functions must contain a single asm block
489 .label_multiple_asm = multiple asm blocks are unsupported in naked functions
490 .label_non_asm = non-asm is unsupported in naked functions
492 passes_naked_functions_operands =
493 only `const` and `sym` operands are supported in naked functions
495 passes_naked_functions_asm_options =
496 asm options unsupported in naked functions: {$unsupported_options}
498 passes_naked_functions_must_use_noreturn =
499 asm in naked functions must use `noreturn` option
500 .suggestion = consider specifying that the asm block is responsible for returning from the function
502 passes_attr_only_on_main =
503 `{$attr}` attribute can only be used on `fn main()`
505 passes_attr_only_on_root_main =
506 `{$attr}` attribute can only be used on root `fn main()`
508 passes_attr_only_in_functions =
509 `{$attr}` attribute can only be used on functions
511 passes_multiple_rustc_main =
512 multiple functions with a `#[rustc_main]` attribute
513 .first = first `#[rustc_main]` function
514 .additional = additional `#[rustc_main]` function
516 passes_multiple_start_functions =
517 multiple `start` functions
518 .label = multiple `start` functions
519 .previous = previous `#[start]` function here
522 the `main` function cannot be declared in an `extern` block
524 passes_unix_sigpipe_values =
525 valid values for `#[unix_sigpipe = "..."]` are `inherit`, `sig_ign`, or `sig_dfl`
527 passes_no_main_function =
528 `main` function not found in crate `{$crate_name}`
529 .here_is_main = here is a function named `main`
530 .one_or_more_possible_main = you have one or more functions named `main` not defined at the crate level
531 .consider_moving_main = consider moving the `main` function definitions
532 .main_must_be_defined_at_crate = the main function must be defined at the crate level{$has_filename ->
533 [true] {" "}(in `{$filename}`)
536 .consider_adding_main_to_file = consider adding a `main` function to `{$filename}`
537 .consider_adding_main_at_crate = consider adding a `main` function at the crate level
538 .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/
539 .non_function_main = non-function item at `crate::main` is found
541 passes_duplicate_lang_item =
542 found duplicate lang item `{$lang_item_name}`
543 .first_defined_span = the lang item is first defined here
544 .first_defined_crate_depends = the lang item is first defined in crate `{$orig_crate_name}` (which `{$orig_dependency_of}` depends on)
545 .first_defined_crate = the lang item is first defined in crate `{$orig_crate_name}`.
546 .first_definition_local = first definition in the local crate (`{$orig_crate_name}`)
547 .second_definition_local = second definition in the local crate (`{$crate_name}`)
548 .first_definition_path = first definition in `{$orig_crate_name}` loaded from {$orig_path}
549 .second_definition_path = second definition in `{$crate_name}` loaded from {$path}
551 passes_duplicate_lang_item_crate =
552 duplicate lang item in crate `{$crate_name}`: `{$lang_item_name}`.
553 .first_defined_span = the lang item is first defined here
554 .first_defined_crate_depends = the lang item is first defined in crate `{$orig_crate_name}` (which `{$orig_dependency_of}` depends on)
555 .first_defined_crate = the lang item is first defined in crate `{$orig_crate_name}`.
556 .first_definition_local = first definition in the local crate (`{$orig_crate_name}`)
557 .second_definition_local = second definition in the local crate (`{$crate_name}`)
558 .first_definition_path = first definition in `{$orig_crate_name}` loaded from {$orig_path}
559 .second_definition_path = second definition in `{$crate_name}` loaded from {$path}
561 passes_duplicate_lang_item_crate_depends =
562 duplicate lang item in crate `{$crate_name}` (which `{$dependency_of}` depends on): `{$lang_item_name}`.
563 .first_defined_span = the lang item is first defined here
564 .first_defined_crate_depends = the lang item is first defined in crate `{$orig_crate_name}` (which `{$orig_dependency_of}` depends on)
565 .first_defined_crate = the lang item is first defined in crate `{$orig_crate_name}`.
566 .first_definition_local = first definition in the local crate (`{$orig_crate_name}`)
567 .second_definition_local = second definition in the local crate (`{$crate_name}`)
568 .first_definition_path = first definition in `{$orig_crate_name}` loaded from {$orig_path}
569 .second_definition_path = second definition in `{$crate_name}` loaded from {$path}
571 passes_incorrect_target =
572 `{$name}` language item must be applied to a {$kind} with {$at_least ->
573 [true] at least {$num}
579 .label = this {$kind} has {$actual_num} generic {$actual_num ->
584 passes_useless_assignment =
585 useless assignment of {$is_field_assign ->
588 } of type `{$ty}` to itself
590 passes_only_has_effect_on =
591 `#[{$attr_name}]` only has an effect on {$target_name ->
594 [implementation_block] implementation blocks
595 *[unspecified] (unspecified--this is a compiler bug)
598 passes_object_lifetime_err =
601 passes_unrecognized_repr_hint =
602 unrecognized representation hint
603 .help = valid reprs are `C`, `align`, `packed`, `transparent`, `simd`, `i8`, `u8`, `i16`, `u16`, `i32`, `u32`, `i64`, `u64`, `i128`, `u128`, `isize`, `usize`
605 passes_attr_application_enum =
606 attribute should be applied to an enum
609 passes_attr_application_struct =
610 attribute should be applied to a struct
611 .label = not a struct
613 passes_attr_application_struct_union =
614 attribute should be applied to a struct or union
615 .label = not a struct or union
617 passes_attr_application_struct_enum_union =
618 attribute should be applied to a struct, enum, or union
619 .label = not a struct, enum, or union
621 passes_attr_application_struct_enum_function_union =
622 attribute should be applied to a struct, enum, function, or union
623 .label = not a struct, enum, function, or union
625 passes_transparent_incompatible =
626 transparent {$target} cannot have other repr hints
628 passes_deprecated_attribute =
629 deprecated attribute must be paired with either stable or unstable attribute
631 passes_useless_stability =
632 this stability annotation is useless
633 .label = useless stability annotation
634 .item = the stability attribute annotates this item
636 passes_invalid_stability =
637 invalid stability version found
638 .label = invalid stability version
639 .item = the stability attribute annotates this item
641 passes_cannot_stabilize_deprecated =
642 an API can't be stabilized after it is deprecated
643 .label = invalid version
644 .item = the stability attribute annotates this item
646 passes_invalid_deprecation_version =
647 invalid deprecation version found
648 .label = invalid deprecation version
649 .item = the stability attribute annotates this item
651 passes_missing_stability_attr =
652 {$descr} has missing stability attribute
654 passes_missing_const_stab_attr =
655 {$descr} has missing const stability attribute
657 passes_trait_impl_const_stable =
658 trait implementations cannot be const stable yet
659 .note = see issue #67792 <https://github.com/rust-lang/rust/issues/67792> for more information
661 passes_feature_only_on_nightly =
662 `#![feature]` may not be used on the {$release_channel} release channel
664 passes_unknown_feature =
665 unknown feature `{$feature}`
667 passes_implied_feature_not_exist =
668 feature `{$implied_by}` implying `{$feature}` does not exist
670 passes_duplicate_feature_err =
671 the feature `{$feature}` has already been declared
673 passes_missing_const_err =
674 attributes `#[rustc_const_unstable]` and `#[rustc_const_stable]` require the function or method to be `const`
675 .help = make the function or method const
676 .label = attribute specified here
680 *[true] multiple {$descr}s are
682 [one] {$descr} {$name_list} is
683 *[other] {$descr}s {$name_list} are
685 } never {$participle}
687 passes_change_fields_to_be_of_unit_type =
688 consider changing the { $num ->
691 } to be of unit type to suppress this warning while preserving the field numbering, or remove the { $num ->
700 } in this {$parent_descr}
702 passes_ignored_derived_impls =
703 `{$name}` has {$trait_list_len ->
705 *[other] derived impls
706 } for the {$trait_list_len ->
707 [one] trait {$trait_list}, but this is
708 *[other] traits {$trait_list}, but these are
709 } intentionally ignored during dead code analysis