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 = not a function definition
52 passes_naked_tracked_caller =
53 cannot use `#[track_caller]` with `#[naked]`
55 passes_should_be_applied_to_struct_enum =
56 attribute should be applied to a struct or enum
57 .label = not a struct or enum
59 passes_should_be_applied_to_trait =
60 attribute should be applied to a trait
63 passes_target_feature_on_statement =
64 {passes_should_be_applied_to_fn}
65 .warn = {-passes_previously_accepted}
66 .label = {passes_should_be_applied_to_fn.label}
68 passes_should_be_applied_to_static =
69 attribute should be applied to a static
72 passes_doc_expect_str =
73 doc {$attr_name} attribute expects a string: #[doc({$attr_name} = "a")]
75 passes_doc_alias_empty =
76 {$attr_str} attribute cannot have empty value
78 passes_doc_alias_bad_char =
79 {$char_} character isn't allowed in {$attr_str}
81 passes_doc_alias_start_end =
82 {$attr_str} cannot start or end with ' '
84 passes_doc_alias_bad_location =
85 {$attr_str} isn't allowed on {$location}
87 passes_doc_alias_not_an_alias =
88 {$attr_str} is the same as the item's name
90 passes_doc_alias_duplicated = doc alias is duplicated
91 .label = first defined here
93 passes_doc_alias_not_string_literal =
94 `#[doc(alias("a"))]` expects string literals
96 passes_doc_alias_malformed =
97 doc alias attribute expects a string `#[doc(alias = "a")]` or a list of strings `#[doc(alias("a", "b"))]`
99 passes_doc_keyword_empty_mod =
100 `#[doc(keyword = "...")]` should be used on empty modules
102 passes_doc_keyword_not_mod =
103 `#[doc(keyword = "...")]` should be used on modules
105 passes_doc_keyword_invalid_ident =
106 `{$doc_keyword}` is not a valid identifier
108 passes_doc_fake_variadic_not_valid =
109 `#[doc(fake_variadic)]` must be used on the first of a set of tuple or fn pointer trait impls with varying arity
111 passes_doc_keyword_only_impl =
112 `#[doc(keyword = "...")]` should be used on impl blocks
114 passes_doc_inline_conflict_first =
117 passes_doc_inline_conflict_second =
118 {"."}..conflicts with this attribute
120 passes_doc_inline_conflict =
121 conflicting doc inlining attributes
122 .help = remove one of the conflicting attributes
124 passes_doc_inline_only_use =
125 this attribute can only be applied to a `use` item
126 .label = only applicable on `use` items
127 .not_a_use_item_label = not a `use` item
128 .note = read <https://doc.rust-lang.org/nightly/rustdoc/the-doc-attribute.html#inline-and-no_inline> for more information
130 passes_doc_attr_not_crate_level =
131 `#![doc({$attr_name} = "...")]` isn't allowed as a crate-level attribute
133 passes_attr_crate_level =
134 this attribute can only be applied at the crate level
135 .suggestion = to apply to the crate, use an inner attribute
136 .help = to apply to the crate, use an inner attribute
137 .note = read <https://doc.rust-lang.org/nightly/rustdoc/the-doc-attribute.html#at-the-crate-level> for more information
139 passes_doc_test_unknown =
140 unknown `doc(test)` attribute `{$path}`
142 passes_doc_test_takes_list =
143 `#[doc(test(...)]` takes a list of attributes
145 passes_doc_primitive =
146 `doc(primitive)` should never have been stable
148 passes_doc_cfg_hide_takes_list =
149 `#[doc(cfg_hide(...)]` takes a list of attributes
151 passes_doc_test_unknown_any =
152 unknown `doc` attribute `{$path}`
154 passes_doc_test_unknown_spotlight =
155 unknown `doc` attribute `{$path}`
156 .note = `doc(spotlight)` was renamed to `doc(notable_trait)`
157 .suggestion = use `notable_trait` instead
158 .no_op_note = `doc(spotlight)` is now a no-op
160 passes_doc_test_unknown_include =
161 unknown `doc` attribute `{$path}`
162 .suggestion = use `doc = include_str!` instead
165 invalid `doc` attribute
167 passes_pass_by_value =
168 `pass_by_value` attribute should be applied to a struct, enum or type alias
169 .label = is not a struct, enum or type alias
171 passes_allow_incoherent_impl =
172 `rustc_allow_incoherent_impl` attribute should be applied to impl items.
173 .label = the only currently supported targets are inherent methods
175 passes_has_incoherent_inherent_impl =
176 `rustc_has_incoherent_inherent_impls` attribute should be applied to types or traits.
177 .label = only adts, extern types and traits are supported
179 passes_must_use_async =
180 `must_use` attribute on `async` functions applies to the anonymous `Future` returned by the function, not the value within
181 .label = this attribute does nothing, the `Future`s returned by async functions are already `must_use`
183 passes_must_use_no_effect =
184 `#[must_use]` has no effect when applied to {$article} {$target}
186 passes_must_not_suspend =
187 `must_not_suspend` attribute should be applied to a struct, enum, or trait
188 .label = is not a struct, enum, or trait
191 {passes_should_be_applied_to_fn}
192 .warn = {-passes_previously_accepted}
193 .label = {passes_should_be_applied_to_fn.label}
196 attribute should be applied to an `extern` block with non-Rust ABI
197 .warn = {-passes_previously_accepted}
198 .label = not an `extern` block
201 attribute should be applied to a foreign function or static
202 .warn = {-passes_previously_accepted}
203 .label = not a foreign function or static
204 .help = try `#[link(name = "{$value}")]` instead
207 attribute should be applied to an `extern crate` item
208 .label = not an `extern crate` item
211 attribute should be applied to a free function, impl method or static
212 .label = not a free function, impl method or static
214 passes_rustc_layout_scalar_valid_range_not_struct =
215 attribute should be applied to a struct
216 .label = not a struct
218 passes_rustc_layout_scalar_valid_range_arg =
219 expected exactly one integer literal argument
221 passes_rustc_legacy_const_generics_only =
222 #[rustc_legacy_const_generics] functions must only have const generics
223 .label = non-const generic parameter
225 passes_rustc_legacy_const_generics_index =
226 #[rustc_legacy_const_generics] must have one index for each generic parameter
227 .label = generic parameters
229 passes_rustc_legacy_const_generics_index_exceed =
230 index exceeds number of arguments
231 .label = there {$arg_count ->
234 } only {$arg_count} {$arg_count ->
239 passes_rustc_legacy_const_generics_index_negative =
240 arguments should be non-negative integers
242 passes_rustc_dirty_clean =
243 attribute requires -Z query-dep-graph to be enabled
245 passes_link_section =
246 attribute should be applied to a function or static
247 .warn = {-passes_previously_accepted}
248 .label = not a function or static
250 passes_no_mangle_foreign =
251 `#[no_mangle]` has no effect on a foreign {$foreign_item_kind}
252 .warn = {-passes_previously_accepted}
253 .label = foreign {$foreign_item_kind}
254 .note = symbol names in extern blocks are not mangled
255 .suggestion = remove this attribute
258 attribute should be applied to a free function, impl method or static
259 .warn = {-passes_previously_accepted}
260 .label = not a free function, impl method or static
263 meta item in `repr` must be an identifier
265 passes_repr_conflicting =
266 conflicting representation hints
269 attribute must be applied to a `static` variable
271 passes_used_compiler_linker =
272 `used(compiler)` and `used(linker)` can't be used together
274 passes_allow_internal_unstable =
275 attribute should be applied to a macro
278 passes_debug_visualizer_placement =
279 attribute should be applied to a module
281 passes_debug_visualizer_invalid =
283 .note_1 = expected: `natvis_file = "..."`
285 .note_3 = expected: `gdb_script_file = "..."`
287 passes_debug_visualizer_unreadable =
288 couldn't read {$file}: {$error}
290 passes_rustc_allow_const_fn_unstable =
291 attribute should be applied to `const fn`
292 .label = not a `const fn`
294 passes_rustc_std_internal_symbol =
295 attribute should be applied to functions or statics
296 .label = not a function or static
299 attribute should be applied to a trait
301 passes_stability_promotable =
302 attribute cannot be applied to an expression
305 attribute is ignored here
308 `#[{$name}]` only has an effect on `extern crate` and modules
310 passes_macro_export =
311 `#[macro_export]` only has an effect on macro definitions
313 passes_plugin_registrar =
314 `#[plugin_registrar]` only has an effect on functions
316 passes_unused_empty_lints_note =
317 attribute `{$name}` with an empty list has no effect
319 passes_unused_no_lints_note =
320 attribute `{$name}` without any lints has no effect
322 passes_unused_default_method_body_const_note =
323 `default_method_body_is_const` has been replaced with `#[const_trait]` on traits
327 .suggestion = remove this attribute
329 passes_non_exported_macro_invalid_attrs =
330 attribute should be applied to function or closure
331 .label = not a function or closure
333 passes_unused_duplicate =
335 .suggestion = remove this attribute
336 .note = attribute also specified here
337 .warn = {-passes_previously_accepted}
339 passes_unused_multiple =
340 multiple `{$name}` attributes
341 .suggestion = remove this attribute
342 .note = attribute also specified here
344 passes_rustc_lint_opt_ty =
345 `#[rustc_lint_opt_ty]` should be applied to a struct
346 .label = not a struct
348 passes_rustc_lint_opt_deny_field_access =
349 `#[rustc_lint_opt_deny_field_access]` should be applied to a field
352 passes_link_ordinal =
353 attribute should be applied to a foreign function or static
354 .label = not a foreign function or static
356 passes_collapse_debuginfo =
357 `collapse_debuginfo` attribute should be applied to macro definitions
358 .label = not a macro definition
360 passes_deprecated_annotation_has_no_effect =
361 this `#[deprecated]` annotation has no effect
362 .suggestion = remove the unnecessary deprecation attribute
364 passes_unknown_external_lang_item =
365 unknown external lang item: `{$lang_item}`
367 passes_missing_panic_handler =
368 `#[panic_handler]` function required, but not found
370 passes_missing_lang_item =
371 language item required, but not found: `{$name}`
372 .note = this can occur when a binary crate with `#![no_std]` is compiled for a target where `{$name}` is defined in the standard library
373 .help = you may be able to compile for a target that doesn't need `{$name}`, specify a target with `--target` or in `.cargo/config`
375 passes_lang_item_on_incorrect_target =
376 `{$name}` language item must be applied to a {$expected_target}
377 .label = attribute should be applied to a {$expected_target}, not a {$actual_target}
379 passes_unknown_lang_item =
380 definition of an unknown language item: `{$name}`
381 .label = definition of unknown language item `{$name}`
383 passes_invalid_attr_at_crate_level =
384 `{$name}` attribute cannot be used at crate level
385 .suggestion = perhaps you meant to use an outer attribute
387 passes_duplicate_diagnostic_item =
388 duplicate diagnostic item found: `{$name}`.
390 passes_duplicate_diagnostic_item_in_crate =
391 duplicate diagnostic item in crate `{$crate_name}`: `{$name}`.
393 passes_diagnostic_item_first_defined =
394 the diagnostic item is first defined here
395 .note = the diagnostic item is first defined in crate `{$orig_crate_name}`.
406 passes_homogeneous_aggregate =
407 homogeneous_aggregate: {$homogeneous_aggregate}
410 layout_of({$normalized_ty}) = {$ty_layout}
412 passes_unrecognized_field =
413 unrecognized field name `{$name}`
416 layout error: {$layout_error}
418 passes_feature_stable_twice =
419 feature `{$feature}` is declared stable since {$since}, but was previously declared stable since {$prev_since}
421 passes_feature_previously_declared =
422 feature `{$feature}` is declared {$declared}, but was previously declared {$prev_declared}
424 passes_expr_not_allowed_in_context =
425 {$expr} is not allowed in a `{$context}`
427 passes_const_impl_const_trait =
428 const `impl`s must be for traits marked with `#[const_trait]`
429 .note = this trait must be annotated with `#[const_trait]`
431 passes_break_non_loop =
432 `break` with value from a `{$kind}` loop
433 .label = can only break with a value inside `loop` or breakable block
434 .label2 = you can't `break` with a value in a `{$kind}` loop
435 .suggestion = use `break` on its own without a value inside this `{$kind}` loop
436 .break_expr_suggestion = alternatively, you might have meant to use the available loop label
438 passes_continue_labeled_block =
439 `continue` pointing to a labeled block
440 .label = labeled blocks cannot be `continue`'d
441 .block_label = labeled block the `continue` points to
443 passes_break_inside_closure =
444 `{$name}` inside of a closure
445 .label = cannot `{$name}` inside of a closure
446 .closure_label = enclosing closure
448 passes_break_inside_async_block =
449 `{$name}` inside of an `async` block
450 .label = cannot `{$name}` inside of an `async` block
451 .async_block_label = enclosing `async` block
453 passes_outside_loop =
454 `{$name}` outside of a loop{$is_break ->
455 [true] {" or labeled block"}
458 .label = cannot `{$name}` outside of a loop{$is_break ->
459 [true] {" or labeled block"}
463 passes_unlabeled_in_labeled_block =
464 unlabeled `{$cf_type}` inside of a labeled block
465 .label = `{$cf_type}` statements that would diverge to or through a labeled block need to bear a label
467 passes_unlabeled_cf_in_while_condition =
468 `break` or `continue` with no label in the condition of a `while` loop
469 .label = unlabeled `{$cf_type}` in the condition of a `while` loop
471 passes_cannot_inline_naked_function =
472 naked functions cannot be inlined
474 passes_undefined_naked_function_abi =
475 Rust ABI is unsupported in naked functions
478 patterns not allowed in naked function parameters
480 passes_params_not_allowed =
481 referencing function parameters is not allowed in naked functions
482 .help = follow the calling convention in asm block to use parameters
484 passes_naked_functions_asm_block =
485 naked functions must contain a single asm block
486 .label_multiple_asm = multiple asm blocks are unsupported in naked functions
487 .label_non_asm = non-asm is unsupported in naked functions
489 passes_naked_functions_operands =
490 only `const` and `sym` operands are supported in naked functions
492 passes_naked_functions_asm_options =
493 asm options unsupported in naked functions: {$unsupported_options}
495 passes_naked_functions_must_use_noreturn =
496 asm in naked functions must use `noreturn` option
497 .suggestion = consider specifying that the asm block is responsible for returning from the function
499 passes_attr_only_on_main =
500 `{$attr}` attribute can only be used on `fn main()`
502 passes_attr_only_on_root_main =
503 `{$attr}` attribute can only be used on root `fn main()`
505 passes_attr_only_in_functions =
506 `{$attr}` attribute can only be used on functions
508 passes_multiple_rustc_main =
509 multiple functions with a `#[rustc_main]` attribute
510 .first = first `#[rustc_main]` function
511 .additional = additional `#[rustc_main]` function
513 passes_multiple_start_functions =
514 multiple `start` functions
515 .label = multiple `start` functions
516 .previous = previous `#[start]` function here
519 the `main` function cannot be declared in an `extern` block
521 passes_unix_sigpipe_values =
522 valid values for `#[unix_sigpipe = "..."]` are `inherit`, `sig_ign`, or `sig_dfl`
524 passes_no_main_function =
525 `main` function not found in crate `{$crate_name}`
526 .here_is_main = here is a function named `main`
527 .one_or_more_possible_main = you have one or more functions named `main` not defined at the crate level
528 .consider_moving_main = consider moving the `main` function definitions
529 .main_must_be_defined_at_crate = the main function must be defined at the crate level{$has_filename ->
530 [true] {" "}(in `{$filename}`)
533 .consider_adding_main_to_file = consider adding a `main` function to `{$filename}`
534 .consider_adding_main_at_crate = consider adding a `main` function at the crate level
535 .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/
536 .non_function_main = non-function item at `crate::main` is found
538 passes_duplicate_lang_item =
539 found duplicate lang item `{$lang_item_name}`
540 .first_defined_span = the lang item is first defined here
541 .first_defined_crate_depends = the lang item is first defined in crate `{$orig_crate_name}` (which `{$orig_dependency_of}` depends on)
542 .first_defined_crate = the lang item is first defined in crate `{$orig_crate_name}`.
543 .first_definition_local = first definition in the local crate (`{$orig_crate_name}`)
544 .second_definition_local = second definition in the local crate (`{$crate_name}`)
545 .first_definition_path = first definition in `{$orig_crate_name}` loaded from {$orig_path}
546 .second_definition_path = second definition in `{$crate_name}` loaded from {$path}
548 passes_duplicate_lang_item_crate =
549 duplicate lang item in crate `{$crate_name}`: `{$lang_item_name}`.
550 .first_defined_span = the lang item is first defined here
551 .first_defined_crate_depends = the lang item is first defined in crate `{$orig_crate_name}` (which `{$orig_dependency_of}` depends on)
552 .first_defined_crate = the lang item is first defined in crate `{$orig_crate_name}`.
553 .first_definition_local = first definition in the local crate (`{$orig_crate_name}`)
554 .second_definition_local = second definition in the local crate (`{$crate_name}`)
555 .first_definition_path = first definition in `{$orig_crate_name}` loaded from {$orig_path}
556 .second_definition_path = second definition in `{$crate_name}` loaded from {$path}
558 passes_duplicate_lang_item_crate_depends =
559 duplicate lang item in crate `{$crate_name}` (which `{$dependency_of}` depends on): `{$lang_item_name}`.
560 .first_defined_span = the lang item is first defined here
561 .first_defined_crate_depends = the lang item is first defined in crate `{$orig_crate_name}` (which `{$orig_dependency_of}` depends on)
562 .first_defined_crate = the lang item is first defined in crate `{$orig_crate_name}`.
563 .first_definition_local = first definition in the local crate (`{$orig_crate_name}`)
564 .second_definition_local = second definition in the local crate (`{$crate_name}`)
565 .first_definition_path = first definition in `{$orig_crate_name}` loaded from {$orig_path}
566 .second_definition_path = second definition in `{$crate_name}` loaded from {$path}
568 passes_incorrect_target =
569 `{$name}` language item must be applied to a {$kind} with {$at_least ->
570 [true] at least {$num}
576 .label = this {$kind} has {$actual_num} generic {$actual_num ->
581 passes_useless_assignment =
582 useless assignment of {$is_field_assign ->
585 } of type `{$ty}` to itself
587 passes_only_has_effect_on =
588 `#[{$attr_name}]` only has an effect on {$target_name ->
591 [implementation_block] implementation blocks
592 *[unspecified] (unspecified--this is a compiler bug)
595 passes_object_lifetime_err =
598 passes_unrecognized_repr_hint =
599 unrecognized representation hint
600 .help = valid reprs are `C`, `align`, `packed`, `transparent`, `simd`, `i8`, `u8`, `i16`, `u16`, `i32`, `u32`, `i64`, `u64`, `i128`, `u128`, `isize`, `usize`
602 passes_attr_application_enum =
603 attribute should be applied to an enum
606 passes_attr_application_struct =
607 attribute should be applied to a struct
608 .label = not a struct
610 passes_attr_application_struct_union =
611 attribute should be applied to a struct or union
612 .label = not a struct or union
614 passes_attr_application_struct_enum_union =
615 attribute should be applied to a struct, enum, or union
616 .label = not a struct, enum, or union
618 passes_attr_application_struct_enum_function_union =
619 attribute should be applied to a struct, enum, function, or union
620 .label = not a struct, enum, function, or union
622 passes_transparent_incompatible =
623 transparent {$target} cannot have other repr hints
625 passes_deprecated_attribute =
626 deprecated attribute must be paired with either stable or unstable attribute
628 passes_useless_stability =
629 this stability annotation is useless
630 .label = useless stability annotation
631 .item = the stability attribute annotates this item
633 passes_invalid_stability =
634 invalid stability version found
635 .label = invalid stability version
636 .item = the stability attribute annotates this item
638 passes_cannot_stabilize_deprecated =
639 an API can't be stabilized after it is deprecated
640 .label = invalid version
641 .item = the stability attribute annotates this item
643 passes_invalid_deprecation_version =
644 invalid deprecation version found
645 .label = invalid deprecation version
646 .item = the stability attribute annotates this item
648 passes_missing_stability_attr =
649 {$descr} has missing stability attribute
651 passes_missing_const_stab_attr =
652 {$descr} has missing const stability attribute
654 passes_trait_impl_const_stable =
655 trait implementations cannot be const stable yet
656 .note = see issue #67792 <https://github.com/rust-lang/rust/issues/67792> for more information
658 passes_feature_only_on_nightly =
659 `#![feature]` may not be used on the {$release_channel} release channel
661 passes_unknown_feature =
662 unknown feature `{$feature}`
664 passes_implied_feature_not_exist =
665 feature `{$implied_by}` implying `{$feature}` does not exist
667 passes_duplicate_feature_err =
668 the feature `{$feature}` has already been declared
670 passes_missing_const_err =
671 attributes `#[rustc_const_unstable]` and `#[rustc_const_stable]` require the function or method to be `const`
672 .help = make the function or method const
673 .label = attribute specified here
677 *[true] multiple {$descr}s are
679 [one] {$descr} {$name_list} is
680 *[other] {$descr}s {$name_list} are
682 } never {$participle}
684 passes_change_fields_to_be_of_unit_type =
685 consider changing the { $num ->
688 } to be of unit type to suppress this warning while preserving the field numbering, or remove the { $num ->
697 } in this {$parent_descr}
699 passes_ignored_derived_impls =
700 `{$name}` has {$trait_list_len ->
702 *[other] derived impls
703 } for the {$trait_list_len ->
704 [one] trait {$trait_list}, but this is
705 *[other] traits {$trait_list}, but these are
706 } intentionally ignored during dead code analysis