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_must_use_async =
186 `must_use` attribute on `async` functions applies to the anonymous `Future` returned by the function, not the value within
187 .label = this attribute does nothing, the `Future`s returned by async functions are already `must_use`
189 passes_must_use_no_effect =
190 `#[must_use]` has no effect when applied to {$article} {$target}
192 passes_must_not_suspend =
193 `must_not_suspend` attribute should be applied to a struct, enum, or trait
194 .label = is not a struct, enum, or trait
197 {passes_should_be_applied_to_fn}
198 .warn = {-passes_previously_accepted}
199 .label = {passes_should_be_applied_to_fn.label}
202 attribute should be applied to an `extern` block with non-Rust ABI
203 .warn = {-passes_previously_accepted}
204 .label = not an `extern` block
207 attribute should be applied to a foreign function or static
208 .warn = {-passes_previously_accepted}
209 .label = not a foreign function or static
210 .help = try `#[link(name = "{$value}")]` instead
213 attribute should be applied to an `extern crate` item
214 .label = not an `extern crate` item
217 attribute should be applied to a free function, impl method or static
218 .label = not a free function, impl method or static
220 passes_rustc_layout_scalar_valid_range_not_struct =
221 attribute should be applied to a struct
222 .label = not a struct
224 passes_rustc_layout_scalar_valid_range_arg =
225 expected exactly one integer literal argument
227 passes_rustc_legacy_const_generics_only =
228 #[rustc_legacy_const_generics] functions must only have const generics
229 .label = non-const generic parameter
231 passes_rustc_legacy_const_generics_index =
232 #[rustc_legacy_const_generics] must have one index for each generic parameter
233 .label = generic parameters
235 passes_rustc_legacy_const_generics_index_exceed =
236 index exceeds number of arguments
237 .label = there {$arg_count ->
240 } only {$arg_count} {$arg_count ->
245 passes_rustc_legacy_const_generics_index_negative =
246 arguments should be non-negative integers
248 passes_rustc_dirty_clean =
249 attribute requires -Z query-dep-graph to be enabled
251 passes_link_section =
252 attribute should be applied to a function or static
253 .warn = {-passes_previously_accepted}
254 .label = not a function or static
256 passes_no_mangle_foreign =
257 `#[no_mangle]` has no effect on a foreign {$foreign_item_kind}
258 .warn = {-passes_previously_accepted}
259 .label = foreign {$foreign_item_kind}
260 .note = symbol names in extern blocks are not mangled
261 .suggestion = remove this attribute
264 attribute should be applied to a free function, impl method or static
265 .warn = {-passes_previously_accepted}
266 .label = not a free function, impl method or static
269 meta item in `repr` must be an identifier
271 passes_repr_conflicting =
272 conflicting representation hints
275 attribute must be applied to a `static` variable
277 passes_used_compiler_linker =
278 `used(compiler)` and `used(linker)` can't be used together
280 passes_allow_internal_unstable =
281 attribute should be applied to a macro
284 passes_debug_visualizer_placement =
285 attribute should be applied to a module
287 passes_debug_visualizer_invalid =
289 .note_1 = expected: `natvis_file = "..."`
291 .note_3 = expected: `gdb_script_file = "..."`
293 passes_debug_visualizer_unreadable =
294 couldn't read {$file}: {$error}
296 passes_rustc_allow_const_fn_unstable =
297 attribute should be applied to `const fn`
298 .label = not a `const fn`
300 passes_rustc_std_internal_symbol =
301 attribute should be applied to functions or statics
302 .label = not a function or static
305 attribute should be applied to a trait
307 passes_stability_promotable =
308 attribute cannot be applied to an expression
311 attribute is ignored here
314 `#[{$name}]` only has an effect on `extern crate` and modules
316 passes_macro_export =
317 `#[macro_export]` only has an effect on macro definitions
319 passes_plugin_registrar =
320 `#[plugin_registrar]` only has an effect on functions
322 passes_unused_empty_lints_note =
323 attribute `{$name}` with an empty list has no effect
325 passes_unused_no_lints_note =
326 attribute `{$name}` without any lints has no effect
328 passes_unused_default_method_body_const_note =
329 `default_method_body_is_const` has been replaced with `#[const_trait]` on traits
333 .suggestion = remove this attribute
335 passes_non_exported_macro_invalid_attrs =
336 attribute should be applied to function or closure
337 .label = not a function or closure
339 passes_unused_duplicate =
341 .suggestion = remove this attribute
342 .note = attribute also specified here
343 .warn = {-passes_previously_accepted}
345 passes_unused_multiple =
346 multiple `{$name}` attributes
347 .suggestion = remove this attribute
348 .note = attribute also specified here
350 passes_rustc_lint_opt_ty =
351 `#[rustc_lint_opt_ty]` should be applied to a struct
352 .label = not a struct
354 passes_rustc_lint_opt_deny_field_access =
355 `#[rustc_lint_opt_deny_field_access]` should be applied to a field
358 passes_link_ordinal =
359 attribute should be applied to a foreign function or static
360 .label = not a foreign function or static
362 passes_collapse_debuginfo =
363 `collapse_debuginfo` attribute should be applied to macro definitions
364 .label = not a macro definition
366 passes_deprecated_annotation_has_no_effect =
367 this `#[deprecated]` annotation has no effect
368 .suggestion = remove the unnecessary deprecation attribute
370 passes_unknown_external_lang_item =
371 unknown external lang item: `{$lang_item}`
373 passes_missing_panic_handler =
374 `#[panic_handler]` function required, but not found
376 passes_missing_lang_item =
377 language item required, but not found: `{$name}`
378 .note = this can occur when a binary crate with `#![no_std]` is compiled for a target where `{$name}` is defined in the standard library
379 .help = you may be able to compile for a target that doesn't need `{$name}`, specify a target with `--target` or in `.cargo/config`
381 passes_lang_item_on_incorrect_target =
382 `{$name}` language item must be applied to a {$expected_target}
383 .label = attribute should be applied to a {$expected_target}, not a {$actual_target}
385 passes_unknown_lang_item =
386 definition of an unknown language item: `{$name}`
387 .label = definition of unknown language item `{$name}`
389 passes_invalid_attr_at_crate_level =
390 `{$name}` attribute cannot be used at crate level
391 .suggestion = perhaps you meant to use an outer attribute
393 passes_duplicate_diagnostic_item =
394 duplicate diagnostic item found: `{$name}`.
396 passes_duplicate_diagnostic_item_in_crate =
397 duplicate diagnostic item in crate `{$crate_name}`: `{$name}`.
399 passes_diagnostic_item_first_defined =
400 the diagnostic item is first defined here
401 .note = the diagnostic item is first defined in crate `{$orig_crate_name}`.
412 passes_homogeneous_aggregate =
413 homogeneous_aggregate: {$homogeneous_aggregate}
416 layout_of({$normalized_ty}) = {$ty_layout}
418 passes_unrecognized_field =
419 unrecognized field name `{$name}`
422 layout error: {$layout_error}
424 passes_feature_stable_twice =
425 feature `{$feature}` is declared stable since {$since}, but was previously declared stable since {$prev_since}
427 passes_feature_previously_declared =
428 feature `{$feature}` is declared {$declared}, but was previously declared {$prev_declared}
430 passes_expr_not_allowed_in_context =
431 {$expr} is not allowed in a `{$context}`
433 passes_const_impl_const_trait =
434 const `impl`s must be for traits marked with `#[const_trait]`
435 .note = this trait must be annotated with `#[const_trait]`
437 passes_break_non_loop =
438 `break` with value from a `{$kind}` loop
439 .label = can only break with a value inside `loop` or breakable block
440 .label2 = you can't `break` with a value in a `{$kind}` loop
441 .suggestion = use `break` on its own without a value inside this `{$kind}` loop
442 .break_expr_suggestion = alternatively, you might have meant to use the available loop label
444 passes_continue_labeled_block =
445 `continue` pointing to a labeled block
446 .label = labeled blocks cannot be `continue`'d
447 .block_label = labeled block the `continue` points to
449 passes_break_inside_closure =
450 `{$name}` inside of a closure
451 .label = cannot `{$name}` inside of a closure
452 .closure_label = enclosing closure
454 passes_break_inside_async_block =
455 `{$name}` inside of an `async` block
456 .label = cannot `{$name}` inside of an `async` block
457 .async_block_label = enclosing `async` block
459 passes_outside_loop =
460 `{$name}` outside of a loop{$is_break ->
461 [true] {" or labeled block"}
464 .label = cannot `{$name}` outside of a loop{$is_break ->
465 [true] {" or labeled block"}
469 passes_unlabeled_in_labeled_block =
470 unlabeled `{$cf_type}` inside of a labeled block
471 .label = `{$cf_type}` statements that would diverge to or through a labeled block need to bear a label
473 passes_unlabeled_cf_in_while_condition =
474 `break` or `continue` with no label in the condition of a `while` loop
475 .label = unlabeled `{$cf_type}` in the condition of a `while` loop
477 passes_cannot_inline_naked_function =
478 naked functions cannot be inlined
480 passes_undefined_naked_function_abi =
481 Rust ABI is unsupported in naked functions
484 patterns not allowed in naked function parameters
486 passes_params_not_allowed =
487 referencing function parameters is not allowed in naked functions
488 .help = follow the calling convention in asm block to use parameters
490 passes_naked_functions_asm_block =
491 naked functions must contain a single asm block
492 .label_multiple_asm = multiple asm blocks are unsupported in naked functions
493 .label_non_asm = non-asm is unsupported in naked functions
495 passes_naked_functions_operands =
496 only `const` and `sym` operands are supported in naked functions
498 passes_naked_functions_asm_options =
499 asm options unsupported in naked functions: {$unsupported_options}
501 passes_naked_functions_must_use_noreturn =
502 asm in naked functions must use `noreturn` option
503 .suggestion = consider specifying that the asm block is responsible for returning from the function
505 passes_attr_only_on_main =
506 `{$attr}` attribute can only be used on `fn main()`
508 passes_attr_only_on_root_main =
509 `{$attr}` attribute can only be used on root `fn main()`
511 passes_attr_only_in_functions =
512 `{$attr}` attribute can only be used on functions
514 passes_multiple_rustc_main =
515 multiple functions with a `#[rustc_main]` attribute
516 .first = first `#[rustc_main]` function
517 .additional = additional `#[rustc_main]` function
519 passes_multiple_start_functions =
520 multiple `start` functions
521 .label = multiple `start` functions
522 .previous = previous `#[start]` function here
525 the `main` function cannot be declared in an `extern` block
527 passes_unix_sigpipe_values =
528 valid values for `#[unix_sigpipe = "..."]` are `inherit`, `sig_ign`, or `sig_dfl`
530 passes_no_main_function =
531 `main` function not found in crate `{$crate_name}`
532 .here_is_main = here is a function named `main`
533 .one_or_more_possible_main = you have one or more functions named `main` not defined at the crate level
534 .consider_moving_main = consider moving the `main` function definitions
535 .main_must_be_defined_at_crate = the main function must be defined at the crate level{$has_filename ->
536 [true] {" "}(in `{$filename}`)
539 .consider_adding_main_to_file = consider adding a `main` function to `{$filename}`
540 .consider_adding_main_at_crate = consider adding a `main` function at the crate level
541 .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/
542 .non_function_main = non-function item at `crate::main` is found
544 passes_duplicate_lang_item =
545 found duplicate lang item `{$lang_item_name}`
546 .first_defined_span = the lang item is first defined here
547 .first_defined_crate_depends = the lang item is first defined in crate `{$orig_crate_name}` (which `{$orig_dependency_of}` depends on)
548 .first_defined_crate = the lang item is first defined in crate `{$orig_crate_name}`.
549 .first_definition_local = first definition in the local crate (`{$orig_crate_name}`)
550 .second_definition_local = second definition in the local crate (`{$crate_name}`)
551 .first_definition_path = first definition in `{$orig_crate_name}` loaded from {$orig_path}
552 .second_definition_path = second definition in `{$crate_name}` loaded from {$path}
554 passes_duplicate_lang_item_crate =
555 duplicate lang item in crate `{$crate_name}`: `{$lang_item_name}`.
556 .first_defined_span = the lang item is first defined here
557 .first_defined_crate_depends = the lang item is first defined in crate `{$orig_crate_name}` (which `{$orig_dependency_of}` depends on)
558 .first_defined_crate = the lang item is first defined in crate `{$orig_crate_name}`.
559 .first_definition_local = first definition in the local crate (`{$orig_crate_name}`)
560 .second_definition_local = second definition in the local crate (`{$crate_name}`)
561 .first_definition_path = first definition in `{$orig_crate_name}` loaded from {$orig_path}
562 .second_definition_path = second definition in `{$crate_name}` loaded from {$path}
564 passes_duplicate_lang_item_crate_depends =
565 duplicate lang item in crate `{$crate_name}` (which `{$dependency_of}` depends on): `{$lang_item_name}`.
566 .first_defined_span = the lang item is first defined here
567 .first_defined_crate_depends = the lang item is first defined in crate `{$orig_crate_name}` (which `{$orig_dependency_of}` depends on)
568 .first_defined_crate = the lang item is first defined in crate `{$orig_crate_name}`.
569 .first_definition_local = first definition in the local crate (`{$orig_crate_name}`)
570 .second_definition_local = second definition in the local crate (`{$crate_name}`)
571 .first_definition_path = first definition in `{$orig_crate_name}` loaded from {$orig_path}
572 .second_definition_path = second definition in `{$crate_name}` loaded from {$path}
574 passes_incorrect_target =
575 `{$name}` language item must be applied to a {$kind} with {$at_least ->
576 [true] at least {$num}
582 .label = this {$kind} has {$actual_num} generic {$actual_num ->
587 passes_useless_assignment =
588 useless assignment of {$is_field_assign ->
591 } of type `{$ty}` to itself
593 passes_only_has_effect_on =
594 `#[{$attr_name}]` only has an effect on {$target_name ->
597 [implementation_block] implementation blocks
598 *[unspecified] (unspecified--this is a compiler bug)
601 passes_object_lifetime_err =
604 passes_unrecognized_repr_hint =
605 unrecognized representation hint
606 .help = valid reprs are `C`, `align`, `packed`, `transparent`, `simd`, `i8`, `u8`, `i16`, `u16`, `i32`, `u32`, `i64`, `u64`, `i128`, `u128`, `isize`, `usize`
608 passes_attr_application_enum =
609 attribute should be applied to an enum
612 passes_attr_application_struct =
613 attribute should be applied to a struct
614 .label = not a struct
616 passes_attr_application_struct_union =
617 attribute should be applied to a struct or union
618 .label = not a struct or union
620 passes_attr_application_struct_enum_union =
621 attribute should be applied to a struct, enum, or union
622 .label = not a struct, enum, or union
624 passes_attr_application_struct_enum_function_union =
625 attribute should be applied to a struct, enum, function, or union
626 .label = not a struct, enum, function, or union
628 passes_transparent_incompatible =
629 transparent {$target} cannot have other repr hints
631 passes_deprecated_attribute =
632 deprecated attribute must be paired with either stable or unstable attribute
634 passes_useless_stability =
635 this stability annotation is useless
636 .label = useless stability annotation
637 .item = the stability attribute annotates this item
639 passes_invalid_stability =
640 invalid stability version found
641 .label = invalid stability version
642 .item = the stability attribute annotates this item
644 passes_cannot_stabilize_deprecated =
645 an API can't be stabilized after it is deprecated
646 .label = invalid version
647 .item = the stability attribute annotates this item
649 passes_invalid_deprecation_version =
650 invalid deprecation version found
651 .label = invalid deprecation version
652 .item = the stability attribute annotates this item
654 passes_missing_stability_attr =
655 {$descr} has missing stability attribute
657 passes_missing_const_stab_attr =
658 {$descr} has missing const stability attribute
660 passes_trait_impl_const_stable =
661 trait implementations cannot be const stable yet
662 .note = see issue #67792 <https://github.com/rust-lang/rust/issues/67792> for more information
664 passes_feature_only_on_nightly =
665 `#![feature]` may not be used on the {$release_channel} release channel
667 passes_unknown_feature =
668 unknown feature `{$feature}`
670 passes_implied_feature_not_exist =
671 feature `{$implied_by}` implying `{$feature}` does not exist
673 passes_duplicate_feature_err =
674 the feature `{$feature}` has already been declared
676 passes_missing_const_err =
677 attributes `#[rustc_const_unstable]` and `#[rustc_const_stable]` require the function or method to be `const`
678 .help = make the function or method const
679 .label = attribute specified here
683 *[true] multiple {$descr}s are
685 [one] {$descr} {$name_list} is
686 *[other] {$descr}s {$name_list} are
688 } never {$participle}
690 passes_change_fields_to_be_of_unit_type =
691 consider changing the { $num ->
694 } to be of unit type to suppress this warning while preserving the field numbering, or remove the { $num ->
703 } in this {$parent_descr}
705 passes_ignored_derived_impls =
706 `{$name}` has {$trait_list_len ->
708 *[other] derived impls
709 } for the {$trait_list_len ->
710 [one] trait {$trait_list}, but this is
711 *[other] traits {$trait_list}, but these are
712 } intentionally ignored during dead code analysis