2024-04-15 18:07:22 +00:00
lint_abs_path_with_module = absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition
.suggestion = use `crate`
lint_ambiguous_glob_reexport = ambiguous glob re-exports
.label_first_reexport = the name `{$name}` in the {$namespace} namespace is first re-exported here
.label_duplicate_reexport = but the name `{$name}` in the {$namespace} namespace is also re-exported here
2024-02-20 20:40:25 +00:00
lint_ambiguous_negative_literals = `-` has lower precedence than method calls, which might be unexpected
.example = e.g. `-4.abs()` equals `-4`; while `(-4).abs()` equals `4`
.negative_literal = add parentheses around the `-` and the literal to call the method on a negative literal
.current_behavior = add parentheses around the literal and the method call to keep the current behavior
2023-11-09 16:37:27 +00:00
lint_ambiguous_wide_pointer_comparisons = ambiguous wide pointer comparison, the comparison includes metadata which may not be expected
.addr_metadata_suggestion = use explicit `std::ptr::eq` method to compare metadata and addresses
.addr_suggestion = use `std::ptr::addr_eq` or untyped pointers to only compare their addresses
2024-04-15 18:07:22 +00:00
lint_associated_const_elided_lifetime = {$elided ->
[true] `&` without an explicit lifetime name cannot be used here
*[false] `'_` cannot be used here
}
.suggestion = use the `'static` lifetime
2024-05-18 20:56:08 +00:00
.note = cannot automatically infer `'static` because of other lifetimes in scope
2024-04-15 18:07:22 +00:00
2023-09-29 20:56:49 +00:00
lint_async_fn_in_trait = use of `async fn` in public traits is discouraged as auto trait bounds cannot be specified
2023-10-03 00:51:13 +00:00
.note = you can suppress this lint if you plan to use the trait only in your own code, or do not care about auto traits like `Send` on the `Future`
2023-10-13 19:11:16 +00:00
.suggestion = you can alternatively desugar to a normal `fn` that returns `impl Future` and add any desired bounds such as `Send`, but these cannot be relaxed without a breaking API change
2023-09-26 20:20:21 +00:00
2022-06-27 13:08:02 +00:00
lint_atomic_ordering_fence = memory fences cannot have `Relaxed` ordering
.help = consider using ordering modes `Acquire`, `Release`, `AcqRel` or `SeqCst`
lint_atomic_ordering_invalid = `{$method}`'s failure ordering may not be `Release` or `AcqRel`, since a failed `{$method}` does not result in a write
.label = invalid failure ordering
.help = consider using `Acquire` or `Relaxed` failure ordering instead
2022-06-27 13:15:31 +00:00
lint_atomic_ordering_load = atomic loads cannot have `Release` or `AcqRel` ordering
.help = consider using ordering modes `Acquire`, `SeqCst` or `Relaxed`
2022-06-27 13:40:55 +00:00
2022-11-10 00:34:49 +00:00
lint_atomic_ordering_store = atomic stores cannot have `Acquire` or `AcqRel` ordering
.help = consider using ordering modes `Release`, `SeqCst` or `Relaxed`
2024-04-15 18:07:22 +00:00
lint_avoid_att_syntax =
avoid using `.att_syntax`, prefer using `options(att_syntax)` instead
lint_avoid_intel_syntax =
avoid using `.intel_syntax`, Intel syntax is the default
2023-02-16 19:04:59 +00:00
lint_bad_attribute_argument = bad attribute argument
2022-10-07 10:14:56 +00:00
lint_bad_opt_access = {$msg}
2024-04-15 18:07:22 +00:00
lint_break_with_label_and_loop = this labeled break expression is easy to confuse with an unlabeled break with a labeled value expression
.suggestion = wrap this expression in parentheses
2022-10-07 10:14:56 +00:00
lint_builtin_allow_internal_unsafe =
`allow_internal_unsafe` allows defining macros using unsafe without triggering the `unsafe_code` lint at their call site
lint_builtin_anonymous_params = anonymous parameters are deprecated and will be removed in the next edition
.suggestion = try naming the parameter or explicitly ignoring it
2022-11-11 00:32:30 +00:00
lint_builtin_clashing_extern_diff_name = `{$this}` redeclares `{$orig}` with a different signature
.previous_decl_label = `{$orig}` previously declared here
.mismatch_label = this signature doesn't match the previous declaration
2022-10-07 00:28:51 +00:00
2023-04-29 15:47:23 +00:00
lint_builtin_clashing_extern_same_name = `{$this}` redeclared with a different signature
.previous_decl_label = `{$orig}` previously declared here
.mismatch_label = this signature doesn't match the previous declaration
lint_builtin_const_no_mangle = const items should never be `#[no_mangle]`
.suggestion = try a static value
2023-04-28 17:17:46 +00:00
2022-10-07 00:28:51 +00:00
lint_builtin_decl_unsafe_fn = declaration of an `unsafe` function
lint_builtin_decl_unsafe_method = declaration of an `unsafe` method
lint_builtin_deprecated_attr_default_suggestion = remove this attribute
lint_builtin_deprecated_attr_link = use of deprecated attribute `{$name}`: {$reason}. See {$link}
.msg_suggestion = {$msg}
.default_suggestion = remove this attribute
2024-06-21 22:20:45 +00:00
lint_builtin_deprecated_attr_used = use of deprecated attribute `{$name}`: no longer used
2022-10-07 00:28:51 +00:00
lint_builtin_deref_nullptr = dereferencing a null pointer
.label = this code causes undefined behavior when executed
lint_builtin_ellipsis_inclusive_range_patterns = `...` range patterns are deprecated
.suggestion = use `..=` for an inclusive range
2022-08-10 07:42:10 +00:00
lint_builtin_explicit_outlives = outlives requirements can be inferred
2022-06-27 13:40:55 +00:00
.suggestion = remove {$count ->
[one] this bound
*[other] these bounds
}
2022-06-27 13:46:45 +00:00
2022-08-10 07:42:10 +00:00
lint_builtin_export_name_fn = declaration of a function with `export_name`
2022-06-27 13:50:58 +00:00
lint_builtin_export_name_method = declaration of a method with `export_name`
2022-08-10 07:42:10 +00:00
lint_builtin_export_name_static = declaration of a static with `export_name`
2024-02-19 23:14:53 +00:00
lint_builtin_global_asm = usage of `core::arch::global_asm`
lint_builtin_global_macro_unsafety = using this macro is unsafe even though it does not need an `unsafe` block
2022-08-10 07:42:10 +00:00
lint_builtin_impl_unsafe_method = implementation of an `unsafe` method
2022-06-27 14:00:01 +00:00
2022-08-10 07:42:10 +00:00
lint_builtin_incomplete_features = the feature `{$name}` is incomplete and may not be safe to use and/or cause compiler crashes
2022-06-28 13:40:11 +00:00
.note = see issue #{$n} <https://github.com/rust-lang/rust/issues/{$n}> for more information
2022-06-27 14:00:01 +00:00
.help = consider using `min_{$name}` instead, which is more stable and complete
2023-03-09 20:54:53 +00:00
lint_builtin_internal_features = the feature `{$name}` is internal to the compiler or standard library
.note = using it is strongly discouraged
2022-08-10 07:42:10 +00:00
lint_builtin_keyword_idents = `{$kw}` is a keyword in the {$next} edition
2022-06-27 14:00:01 +00:00
.suggestion = you can use a raw identifier to stay compatible
2022-06-27 14:09:24 +00:00
lint_builtin_link_section_fn = declaration of a function with `link_section`
2022-06-27 14:18:30 +00:00
2023-04-10 20:02:52 +00:00
lint_builtin_link_section_static = declaration of a static with `link_section`
2022-06-27 14:27:41 +00:00
2022-09-18 15:46:16 +00:00
lint_builtin_missing_copy_impl = type could implement `Copy`; consider adding `impl Copy`
2022-06-27 14:27:41 +00:00
2022-08-10 07:42:10 +00:00
lint_builtin_missing_debug_impl =
type does not implement `{$debug}`; consider adding `#[derive(Debug)]` or a manual implementation
2022-06-27 14:47:27 +00:00
2023-03-05 03:39:37 +00:00
lint_builtin_missing_doc = missing documentation for {$article} {$desc}
2022-10-22 20:32:54 +00:00
lint_builtin_mutable_transmutes =
transmuting &T to &mut T is undefined behavior, even if the reference is unused, consider instead using an UnsafeCell
2022-08-10 07:42:10 +00:00
lint_builtin_no_mangle_fn = declaration of a `no_mangle` function
2022-06-27 14:47:27 +00:00
lint_builtin_no_mangle_generic = functions generic over types or consts must be mangled
.suggestion = remove this attribute
2022-06-27 14:57:35 +00:00
2023-04-10 20:02:52 +00:00
lint_builtin_no_mangle_method = declaration of a `no_mangle` method
lint_builtin_no_mangle_static = declaration of a `no_mangle` static
lint_builtin_non_shorthand_field_patterns = the `{$ident}:` in this pattern is redundant
.suggestion = use shorthand field pattern
2022-12-09 02:27:03 +00:00
2022-08-10 07:42:10 +00:00
lint_builtin_overridden_symbol_name =
the linker's behavior with multiple libraries exporting duplicate symbol names is undefined and Rust cannot provide guarantees when you manually override them
2022-06-27 14:57:35 +00:00
2022-08-10 07:42:10 +00:00
lint_builtin_overridden_symbol_section =
the program's behavior with overridden link sections on items is unpredictable and Rust cannot provide guarantees when you manually override them
2022-06-27 14:57:35 +00:00
2022-08-10 07:42:10 +00:00
lint_builtin_special_module_name_used_lib = found module declaration for lib.rs
2022-06-27 14:57:35 +00:00
.note = lib.rs is the root of this crate's library target
.help = to refer to it from other targets, use the library's name as the path
lint_builtin_special_module_name_used_main = found module declaration for main.rs
.note = a binary crate cannot be used as library
2022-06-27 15:33:57 +00:00
lint_builtin_trivial_bounds = {$predicate_kind_name} bound {$predicate} does not depend on any type or lifetime parameters
2024-06-15 19:34:44 +00:00
lint_builtin_type_alias_bounds_enable_feat_help = add `#![feature(lazy_type_alias)]` to the crate attributes to enable the desired semantics
lint_builtin_type_alias_bounds_label = will not be checked at usage sites of the type alias
lint_builtin_type_alias_bounds_limitation_note = this is a known limitation of the type checker that may be lifted in a future edition.
see issue #112792 <https://github.com/rust-lang/rust/issues/112792> for more information
lint_builtin_type_alias_bounds_param_bounds = bounds on generic parameters in type aliases are not enforced
.suggestion = remove {$count ->
[one] this bound
*[other] these bounds
}
lint_builtin_type_alias_bounds_qualify_assoc_tys_sugg = fully qualify this associated type
lint_builtin_type_alias_bounds_where_clause = where clauses on type aliases are not enforced
.suggestion = remove this where clause
2022-06-27 15:46:25 +00:00
2022-08-10 07:42:10 +00:00
lint_builtin_unpermitted_type_init_label = this code causes undefined behavior when executed
2022-06-27 15:57:40 +00:00
lint_builtin_unpermitted_type_init_label_suggestion = help: use `MaybeUninit<T>` instead, and only call `assume_init` after initialization is done
2022-06-27 16:02:46 +00:00
lint_builtin_unpermitted_type_init_uninit = the type `{$ty}` does not permit being left uninitialized
2022-06-27 16:11:53 +00:00
lint_builtin_unpermitted_type_init_zeroed = the type `{$ty}` does not permit zero-initialization
lint_builtin_unreachable_pub = unreachable `pub` {$what}
.suggestion = consider restricting its visibility
.help = or consider exporting it for use by other crates
lint_builtin_unsafe_block = usage of an `unsafe` block
2022-06-27 16:42:47 +00:00
2024-07-09 20:35:51 +00:00
lint_builtin_unsafe_extern_block = usage of an `unsafe extern` block
2022-08-10 07:42:10 +00:00
lint_builtin_unsafe_impl = implementation of an `unsafe` trait
2023-03-24 17:00:49 +00:00
lint_builtin_unsafe_trait = declaration of an `unsafe` trait
2023-12-05 07:56:30 +00:00
lint_builtin_unstable_features = use of an unstable feature
2022-06-27 16:42:47 +00:00
2022-08-10 07:42:10 +00:00
lint_builtin_unused_doc_comment = unused doc comment
.label = rustdoc does not generate documentation for {$kind}
2022-06-27 16:42:47 +00:00
.plain_help = use `//` for a plain comment
.block_help = use `/* */` for a plain comment
lint_builtin_while_true = denote infinite loops with `loop {"{"} ... {"}"}`
.suggestion = use `loop`
2024-04-15 18:07:22 +00:00
lint_byte_slice_in_packed_struct_with_derive = {$ty} slice in a packed struct that derives a built-in trait
.help = consider implementing the trait by hand, or remove the `packed` attribute
2024-04-14 20:11:14 +00:00
lint_cfg_attr_no_attributes =
`#[cfg_attr]` does not expand to any attributes
2022-06-27 16:42:47 +00:00
lint_check_name_unknown_tool = unknown lint tool: `{$tool_name}`
2024-06-27 19:32:29 +00:00
lint_closure_returning_async_block = closure returning async block can be made into an async closure
.label = this async block can be removed, and the closure can be turned into an async closure
2024-06-28 19:56:06 +00:00
.suggestion = turn this into an async closure
2024-06-27 19:32:29 +00:00
2022-08-10 07:42:10 +00:00
lint_command_line_source = `forbid` lint level was set on command line
2022-06-28 08:41:49 +00:00
2023-08-04 16:46:08 +00:00
lint_confusable_identifier_pair = found both `{$existing_sym}` and `{$sym}` as identifiers, which look alike
.current_use = this identifier can be confused with `{$existing_sym}`
.other_use = other identifier used here
2022-06-28 08:41:49 +00:00
2024-04-14 20:11:14 +00:00
lint_crate_name_in_cfg_attr_deprecated =
2024-04-11 17:46:00 +00:00
`crate_name` within an `#![cfg_attr]` attribute is deprecated
2024-04-14 20:11:14 +00:00
lint_crate_type_in_cfg_attr_deprecated =
2024-04-11 17:46:00 +00:00
`crate_type` within an `#![cfg_attr]` attribute is deprecated
2024-04-14 20:11:14 +00:00
2022-08-10 07:42:10 +00:00
lint_cstring_ptr = getting the inner pointer of a temporary `CString`
.as_ptr_label = this pointer will be invalid
.unwrap_label = this `CString` is deallocated at the end of the statement, bind it to a variable to extend its lifetime
.note = pointers do not have a lifetime; when calling `as_ptr` the `CString` will be deallocated at the end of the statement because nothing is referencing it as far as the type system is concerned
.help = for more information, see https://doc.rust-lang.org/reference/destructors.html
2022-06-28 08:41:49 +00:00
2024-04-15 18:07:22 +00:00
lint_custom_inner_attribute_unstable = custom inner attributes are unstable
2022-08-10 07:42:10 +00:00
lint_default_hash_types = prefer `{$preferred}` over `{$used}`, it has better performance
.note = a `use rustc_data_structures::fx::{$preferred}` may be necessary
2022-06-28 08:41:49 +00:00
2022-08-10 07:42:10 +00:00
lint_default_source = `forbid` lint level is the default for {$id}
2022-06-28 08:41:49 +00:00
2022-08-10 07:42:10 +00:00
lint_deprecated_lint_name =
2024-06-21 22:20:45 +00:00
lint name `{$name}` is deprecated and may not have an effect in the future
2022-08-10 07:42:10 +00:00
.suggestion = change it to
2023-08-28 19:28:51 +00:00
.help = change it to {$replace}
2022-06-28 08:41:49 +00:00
2024-04-15 18:07:22 +00:00
lint_deprecated_where_clause_location = where clause not allowed here
.note = see issue #89122 <https://github.com/rust-lang/rust/issues/89122> for more information
.suggestion_move_to_end = move it to the end of the type declaration
.suggestion_remove_where = remove this `where`
2024-04-14 17:59:54 +00:00
2022-08-10 07:42:10 +00:00
lint_diag_out_of_impl =
2024-03-08 01:03:51 +00:00
diagnostics should only be created in `Diagnostic`/`Subdiagnostic`/`LintDiagnostic` impls
2022-06-28 08:41:49 +00:00
2022-08-10 07:42:10 +00:00
lint_drop_glue =
types that do not implement `Drop` can still have drop glue, consider instead using `{$needs_drop}` to detect whether a type is trivially dropped
2022-06-28 08:41:49 +00:00
2022-08-10 07:42:10 +00:00
lint_drop_trait_constraints =
bounds on `{$predicate}` are most likely incorrect, consider instead using `{$needs_drop}` to detect whether a type can be trivially dropped
2022-06-28 08:41:49 +00:00
2022-08-10 07:42:10 +00:00
lint_dropping_copy_types = calls to `std::mem::drop` with a value that implements `Copy` does nothing
.label = argument has type `{$arg_ty}`
2022-06-28 08:41:49 +00:00
lint_dropping_references = calls to `std::mem::drop` with a reference instead of an owned value does nothing
.label = argument has type `{$arg_ty}`
2024-04-15 18:07:22 +00:00
lint_duplicate_macro_attribute =
duplicated attribute
lint_duplicate_matcher_binding = duplicate matcher binding
2022-08-10 07:42:10 +00:00
lint_enum_intrinsics_mem_discriminant =
the return value of `mem::discriminant` is unspecified when called with a non-enum type
2024-06-21 22:20:45 +00:00
.note = the argument to `discriminant` should be a reference to an enum, but it was passed a reference to a `{$ty_param}`, which is not an enum
2022-06-28 08:41:49 +00:00
2022-08-10 07:42:10 +00:00
lint_enum_intrinsics_mem_variant =
the return value of `mem::variant_count` is unspecified when called with a non-enum type
2024-06-21 22:20:45 +00:00
.note = the type parameter of `variant_count` should be an enum, but it was instantiated with the type `{$ty_param}`, which is not an enum
2022-06-28 08:41:49 +00:00
2022-08-10 07:42:10 +00:00
lint_expectation = this lint expectation is unfulfilled
.note = the `unfulfilled_lint_expectations` lint can't be expected and will always produce this message
.rationale = {$rationale}
2022-06-28 08:41:49 +00:00
2024-04-15 18:07:22 +00:00
lint_extern_crate_not_idiomatic = `extern crate` is not idiomatic in the new edition
.suggestion = convert it to a `use`
2024-04-14 17:59:54 +00:00
lint_extern_without_abi = extern declarations without an explicit ABI are deprecated
2024-04-15 18:07:22 +00:00
.label = ABI should be specified here
.help = the default ABI is {$default_abi}
2024-04-14 17:59:54 +00:00
2022-08-10 07:42:10 +00:00
lint_for_loops_over_fallibles =
2024-05-15 15:59:13 +00:00
for loop over {$article} `{$ref_prefix}{$ty}`. This is more readably written as an `if let` statement
2022-08-10 07:42:10 +00:00
.suggestion = consider using `if let` to clear intent
.remove_next = to iterate over `{$recv_snip}` remove the call to `next`
.use_while_let = to check pattern in a loop use `while let`
.use_question_mark = consider unwrapping the `Result` with `?` to iterate over its contents
2022-06-28 08:41:49 +00:00
2022-08-10 07:42:10 +00:00
lint_forgetting_copy_types = calls to `std::mem::forget` with a value that implements `Copy` does nothing
.label = argument has type `{$arg_ty}`
2024-05-25 03:04:13 +00:00
2022-08-10 07:42:10 +00:00
lint_forgetting_references = calls to `std::mem::forget` with a reference instead of an owned value does nothing
2023-04-10 09:55:37 +00:00
.label = argument has type `{$arg_ty}`
2022-06-28 08:41:49 +00:00
2024-04-15 18:07:22 +00:00
lint_hidden_glob_reexport = private item shadows public glob re-export
.note_glob_reexport = the name `{$name}` in the {$namespace} namespace is supposed to be publicly re-exported here
.note_private_item = but the private item here shadows it
lint_hidden_lifetime_parameters = hidden lifetime parameters in types are deprecated
2022-08-10 07:42:10 +00:00
lint_hidden_unicode_codepoints = unicode codepoint changing visible direction of text present in {$label}
2022-06-27 13:40:55 +00:00
.label = this {$label} contains {$count ->
2022-08-10 07:42:10 +00:00
[one] an invisible
2022-06-27 13:40:55 +00:00
*[other] invisible
2022-08-10 07:42:10 +00:00
} unicode text flow control {$count ->
2022-06-27 13:40:55 +00:00
[one] codepoint
*[other] codepoints
2023-05-23 01:51:25 +00:00
}
2022-08-10 07:42:10 +00:00
.note = these kind of unicode codepoints change the way text flows on applications that support them, but can cause confusion because they change the order of characters on the screen
.suggestion_remove = if their presence wasn't intentional, you can remove them
.suggestion_escape = if you want to keep them but make them visible in your source code, you can escape them
.no_suggestion_note_escape = if you want to keep them but make them visible in your source code, you can escape them: {$escaped}
2022-06-28 08:41:49 +00:00
2022-08-10 07:42:10 +00:00
lint_identifier_non_ascii_char = identifier contains non-ASCII characters
2022-06-28 08:41:49 +00:00
2024-01-23 13:17:06 +00:00
lint_identifier_uncommon_codepoints = identifier contains {$codepoints_len ->
2024-02-09 10:26:30 +00:00
[one] { $identifier_type ->
[Exclusion] a character from an archaic script
[Technical] a character that is for non-linguistic, specialized usage
[Limited_Use] a character from a script in limited use
[Not_NFKC] a non normalized (NFKC) character
*[other] an uncommon character
}
*[other] { $identifier_type ->
[Exclusion] {$codepoints_len} characters from archaic scripts
[Technical] {$codepoints_len} characters that are for non-linguistic, specialized usage
[Limited_Use] {$codepoints_len} characters from scripts in limited use
[Not_NFKC] {$codepoints_len} non normalized (NFKC) characters
*[other] uncommon characters
}
2024-01-23 13:16:24 +00:00
}: {$codepoints}
2024-02-09 10:26:30 +00:00
.note = {$codepoints_len ->
[one] this character is
*[other] these characters are
} included in the{$identifier_type ->
[Restricted] {""}
*[other] {" "}{$identifier_type}
} Unicode general security profile
2022-06-28 08:41:49 +00:00
2022-08-10 07:42:10 +00:00
lint_ignored_unless_crate_specified = {$level}({$name}) is ignored unless specified at crate level
2022-06-28 08:41:49 +00:00
2024-04-15 18:07:22 +00:00
lint_ill_formed_attribute_input = {$num_suggestions ->
[1] attribute must be of the form {$suggestions}
*[other] valid forms for the attribute are {$suggestions}
}
2024-04-20 15:22:06 +00:00
lint_impl_trait_overcaptures = `{$self_ty}` will capture more lifetimes than possibly intended in edition 2024
.note = specifically, {$num_captured ->
[one] this lifetime is
*[other] these lifetimes are
} in scope but not mentioned in the type's bounds
.note2 = all lifetimes in scope will be captured by `impl Trait`s in edition 2024
.suggestion = use the precise capturing `use<...>` syntax to make the captures explicit
lint_impl_trait_redundant_captures = all possible in-scope parameters are already captured, so `use<...>` syntax is redundant
.suggestion = remove the `use<...>` syntax
2022-08-10 07:42:10 +00:00
lint_improper_ctypes = `extern` {$desc} uses type `{$ty}`, which is not FFI-safe
2022-06-28 08:41:49 +00:00
.label = not FFI-safe
2022-08-10 07:42:10 +00:00
.note = the type is defined here
2022-06-28 08:52:05 +00:00
lint_improper_ctypes_128bit = 128-bit integers don't currently have a known stable ABI
2022-06-28 08:59:30 +00:00
lint_improper_ctypes_array_help = consider passing a pointer to the array
2022-08-10 07:42:10 +00:00
lint_improper_ctypes_array_reason = passing raw arrays by value is not FFI-safe
lint_improper_ctypes_box = box cannot be represented as a single pointer
2022-06-28 08:59:30 +00:00
lint_improper_ctypes_char_help = consider using `u32` or `libc::wchar_t` instead
2022-08-10 07:42:10 +00:00
lint_improper_ctypes_char_reason = the `char` type has no C equivalent
lint_improper_ctypes_dyn = trait objects have no C equivalent
2022-06-28 08:59:30 +00:00
2022-08-10 07:42:10 +00:00
lint_improper_ctypes_enum_repr_help =
consider adding a `#[repr(C)]`, `#[repr(transparent)]`, or integer `#[repr(...)]` attribute to this enum
2022-06-28 09:14:10 +00:00
2022-08-10 07:42:10 +00:00
lint_improper_ctypes_enum_repr_reason = enum has no representation hint
2022-06-28 09:14:10 +00:00
lint_improper_ctypes_fnptr_help = consider using an `extern fn(...) -> ...` function pointer instead
2022-08-10 07:42:10 +00:00
lint_improper_ctypes_fnptr_reason = this function pointer has Rust-specific calling convention
2022-06-28 09:14:10 +00:00
lint_improper_ctypes_non_exhaustive = this enum is non-exhaustive
lint_improper_ctypes_non_exhaustive_variant = this enum has non-exhaustive variants
2022-08-10 07:42:10 +00:00
lint_improper_ctypes_only_phantomdata = composed only of `PhantomData`
2022-06-28 09:19:11 +00:00
2022-08-10 07:42:10 +00:00
lint_improper_ctypes_opaque = opaque types have no C equivalent
2022-06-28 09:19:11 +00:00
2023-02-02 13:57:36 +00:00
lint_improper_ctypes_pat_help = consider using the base type instead
lint_improper_ctypes_pat_reason = pattern types have no C equivalent
2022-08-10 07:42:10 +00:00
lint_improper_ctypes_slice_help = consider using a raw pointer instead
2022-06-28 09:28:57 +00:00
2022-08-10 07:42:10 +00:00
lint_improper_ctypes_slice_reason = slices have no C equivalent
lint_improper_ctypes_str_help = consider using `*const u8` and a length instead
2022-06-28 09:32:57 +00:00
2022-08-10 07:42:10 +00:00
lint_improper_ctypes_str_reason = string slices have no C equivalent
lint_improper_ctypes_struct_fieldless_help = consider adding a member to this struct
2022-06-28 09:43:38 +00:00
2022-08-10 07:42:10 +00:00
lint_improper_ctypes_struct_fieldless_reason = this struct has no fields
lint_improper_ctypes_struct_layout_help = consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this struct
2022-06-28 09:55:42 +00:00
2022-08-10 07:42:10 +00:00
lint_improper_ctypes_struct_layout_reason = this struct has unspecified layout
lint_improper_ctypes_struct_non_exhaustive = this struct is non-exhaustive
2022-06-28 09:55:42 +00:00
lint_improper_ctypes_struct_zst = this struct contains only zero-sized fields
2022-06-28 09:56:01 +00:00
2022-08-10 07:42:10 +00:00
lint_improper_ctypes_tuple_help = consider using a struct instead
2022-06-28 09:56:18 +00:00
2022-08-10 07:42:10 +00:00
lint_improper_ctypes_tuple_reason = tuples have unspecified layout
lint_improper_ctypes_union_fieldless_help = consider adding a member to this union
2022-06-28 09:57:05 +00:00
lint_improper_ctypes_union_fieldless_reason = this union has no fields
lint_improper_ctypes_union_layout_help = consider adding a `#[repr(C)]` or `#[repr(transparent)]` attribute to this union
lint_improper_ctypes_union_layout_reason = this union has unspecified layout
lint_improper_ctypes_union_non_exhaustive = this union is non-exhaustive
2024-04-15 18:07:22 +00:00
lint_incomplete_include =
include macro expected single expression in source
lint_inner_macro_attribute_unstable = inner macro attributes are unstable
2024-06-24 22:37:44 +00:00
lint_invalid_asm_label_binary = avoid using labels containing only the digits `0` and `1` in inline assembly
.label = use a different label that doesn't start with `0` or `1`
2024-07-18 20:12:28 +00:00
.help = start numbering with `2` instead
.note1 = an LLVM bug makes these labels ambiguous with a binary literal number on x86
.note2 = see <https://github.com/llvm/llvm-project/issues/99547> for more information
2024-06-24 22:37:44 +00:00
lint_invalid_asm_label_format_arg = avoid using named labels in inline assembly
.help = only local labels of the form `<number>:` should be used in inline asm
.note1 = format arguments may expand to a non-numeric value
.note2 = see the asm section of Rust By Example <https://doc.rust-lang.org/nightly/rust-by-example/unsafe/asm.html#labels> for more information
lint_invalid_asm_label_named = avoid using named labels in inline assembly
.help = only local labels of the form `<number>:` should be used in inline asm
.note = see the asm section of Rust By Example <https://doc.rust-lang.org/nightly/rust-by-example/unsafe/asm.html#labels> for more information
lint_invalid_asm_label_no_span = the label may be declared in the expansion of a macro
2024-04-15 18:07:22 +00:00
lint_invalid_crate_type_value = invalid `crate_type` value
.suggestion = did you mean
2023-05-13 16:33:19 +00:00
# FIXME: we should ordinalize $valid_up_to when we add support for doing so
lint_invalid_from_utf8_checked = calls to `{$method}` with a invalid literal always return an error
.label = the literal was valid UTF-8 up to the {$valid_up_to} bytes
2023-05-13 15:12:45 +00:00
# FIXME: we should ordinalize $valid_up_to when we add support for doing so
lint_invalid_from_utf8_unchecked = calls to `{$method}` with a invalid literal are undefined behavior
.label = the literal was valid UTF-8 up to the {$valid_up_to} bytes
2023-05-20 21:05:09 +00:00
lint_invalid_nan_comparisons_eq_ne = incorrect NaN comparison, NaN cannot be directly compared to itself
.suggestion = use `f32::is_nan()` or `f64::is_nan()` instead
lint_invalid_nan_comparisons_lt_le_gt_ge = incorrect NaN comparison, NaN is not orderable
2023-07-14 20:25:47 +00:00
lint_invalid_reference_casting_assign_to_ref = assigning to `&T` is undefined behavior, consider using an `UnsafeCell`
.label = casting happend here
2023-12-13 13:40:19 +00:00
lint_invalid_reference_casting_bigger_layout = casting references to a bigger memory layout than the backing allocation is undefined behavior, even if the reference is unused
.label = casting happend here
.alloc = backing allocation comes from here
.layout = casting from `{$from_ty}` ({$from_size} bytes) to `{$to_ty}` ({$to_size} bytes)
2023-07-14 20:25:47 +00:00
lint_invalid_reference_casting_borrow_as_mut = casting `&T` to `&mut T` is undefined behavior, even if the reference is unused, consider instead using an `UnsafeCell`
2023-07-14 20:10:14 +00:00
.label = casting happend here
2023-07-06 19:45:24 +00:00
2023-08-22 15:17:44 +00:00
lint_invalid_reference_casting_note_book = for more information, visit <https://doc.rust-lang.org/book/ch15-05-interior-mutability.html>
2023-10-04 14:03:39 +00:00
lint_invalid_reference_casting_note_ty_has_interior_mutability = even for types with interior mutability, the only legal way to obtain a mutable pointer from a shared reference is through `UnsafeCell::get`
2024-04-15 18:07:22 +00:00
lint_legacy_derive_helpers = derive helper attribute is used before it is introduced
.label = the attribute is introduced here
2022-08-10 07:42:10 +00:00
lint_lintpass_by_hand = implementing `LintPass` by hand
2022-06-28 09:57:05 +00:00
.help = try using `declare_lint_pass!` or `impl_lint_pass!` instead
2024-04-15 18:07:22 +00:00
lint_macro_expanded_macro_exports_accessed_by_absolute_paths = macro-expanded `macro_export` macros from the current crate cannot be referred to by absolute paths
.note = the macro is defined here
2024-05-25 08:44:24 +00:00
lint_macro_expr_fragment_specifier_2024_migration =
the `expr` fragment specifier will accept more expressions in the 2024 edition
.suggestion = to keep the existing behavior, use the `expr_2021` fragment specifier
2024-04-15 18:07:22 +00:00
lint_macro_is_private = macro `{$ident}` is private
lint_macro_rule_never_used = rule #{$n} of macro `{$name}` is never used
lint_macro_use_deprecated =
2024-06-03 05:17:19 +00:00
applying the `#[macro_use]` attribute to an `extern crate` item is deprecated
.help = remove it and import macros at use sites with a `use` item instead
2024-04-15 18:07:22 +00:00
2022-08-10 07:42:10 +00:00
lint_malformed_attribute = malformed lint attribute input
2022-06-28 09:57:05 +00:00
2022-08-10 07:42:10 +00:00
lint_map_unit_fn = `Iterator::map` call that discard the iterator's values
.note = `Iterator::map`, like many of the methods on `Iterator`, gets executed lazily, meaning that its effects won't be visible until it is iterated
.function_label = this function returns `()`, which is likely not what you wanted
2023-02-16 19:04:59 +00:00
.argument_label = called `Iterator::map` with callable that returns `()`
2022-08-10 07:42:10 +00:00
.map_label = after this call to map, the resulting iterator is `impl Iterator<Item = ()>`, which means the only information carried by the iterator is the number of items
2023-02-16 19:04:59 +00:00
.suggestion = you might have meant to use `Iterator::for_each`
2022-06-28 09:57:05 +00:00
2024-06-03 05:17:19 +00:00
lint_metavariable_still_repeating = variable `{$name}` is still repeating at this depth
2024-04-15 18:07:22 +00:00
lint_metavariable_wrong_operator = meta-variable repeats with different Kleene operator
lint_missing_fragment_specifier = missing fragment specifier
2024-05-21 15:27:21 +00:00
lint_missing_unsafe_on_extern = extern blocks should be unsafe
2024-06-04 01:27:57 +00:00
.suggestion = needs `unsafe` before the extern keyword
2024-05-21 15:27:21 +00:00
2022-08-10 07:42:10 +00:00
lint_mixed_script_confusables =
the usage of Script Group `{$set}` in this crate consists solely of mixed script confusables
.includes_note = the usage includes {$includes}
.note = please recheck to make sure their usages are indeed what you want
2022-06-28 09:57:05 +00:00
2022-08-10 07:42:10 +00:00
lint_multiple_supertrait_upcastable = `{$ident}` is object-safe and has multiple supertraits
2022-06-28 09:57:05 +00:00
2024-04-15 18:07:22 +00:00
lint_named_argument_used_positionally = named argument `{$named_arg_name}` is not used by name
.label_named_arg = this named argument is referred to by position in formatting string
.label_position_arg = this formatting argument uses named argument `{$named_arg_name}` by position
.suggestion = use the named argument by name to avoid ambiguity
2022-08-10 07:42:10 +00:00
lint_node_source = `forbid` level set here
.note = {$reason}
2022-06-28 09:57:05 +00:00
2024-01-07 19:37:51 +00:00
lint_non_binding_let_multi_drop_fn =
consider immediately dropping the value using `drop(..)` after the `let` statement
2022-08-10 07:42:10 +00:00
lint_non_binding_let_multi_suggestion =
consider immediately dropping the value
2022-06-28 09:57:05 +00:00
2022-08-10 07:42:10 +00:00
lint_non_binding_let_on_drop_type =
non-binding let on a type that implements `Drop`
2022-06-28 09:57:19 +00:00
2022-08-10 07:42:10 +00:00
lint_non_binding_let_on_sync_lock =
non-binding let on a synchronization lock
2022-06-28 10:23:11 +00:00
2022-08-10 07:42:10 +00:00
lint_non_binding_let_suggestion =
consider binding to an unused variable to avoid immediately dropping the value
2022-06-28 10:27:26 +00:00
lint_non_camel_case_type = {$sort} `{$name}` should have an upper camel case name
.suggestion = convert the identifier to upper camel case
.label = should have an UpperCamelCase name
2022-06-28 10:31:44 +00:00
2022-08-10 07:42:10 +00:00
lint_non_existent_doc_keyword = found non-existing keyword `{$keyword}` used in `#[doc(keyword = "...")]`
2022-06-28 10:31:44 +00:00
.help = only existing keywords are allowed in core/std
2022-06-28 10:51:15 +00:00
2022-08-10 07:42:10 +00:00
lint_non_fmt_panic = panic message is not a string literal
.note = this usage of `{$name}!()` is deprecated; it will be a hard error in Rust 2021
.more_info_note = for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html>
.supports_fmt_note = the `{$name}!()` macro supports formatting, so there's no need for the `format!()` macro here
.supports_fmt_suggestion = remove the `format!(..)` macro call
.display_suggestion = add a "{"{"}{"}"}" format string to `Display` the message
.debug_suggestion =
add a "{"{"}:?{"}"}" format string to use the `Debug` implementation of `{$ty}`
.panic_suggestion = {$already_suggested ->
2022-06-27 15:33:57 +00:00
[true] or use
2022-08-10 07:42:10 +00:00
*[false] use
} std::panic::panic_any instead
2022-06-28 12:35:33 +00:00
2022-08-10 07:42:10 +00:00
lint_non_fmt_panic_braces =
panic message contains {$count ->
2022-06-28 12:35:33 +00:00
[one] a brace
*[other] braces
}
.note = this message is not used as a format string, but will be in Rust 2021
2022-08-10 07:42:10 +00:00
.suggestion = add a "{"{"}{"}"}" format string to use the message literally
2022-06-28 12:40:59 +00:00
2022-08-10 07:42:10 +00:00
lint_non_fmt_panic_unused =
panic message contains {$count ->
[one] an unused
*[other] unused
} formatting {$count ->
[one] placeholder
*[other] placeholders
2023-05-23 01:51:25 +00:00
}
2022-08-10 07:42:10 +00:00
.note = this message is not used as a format string when given without arguments, but will be in Rust 2021
.add_args_suggestion = add the missing {$count ->
2022-06-27 15:33:57 +00:00
[one] argument
2022-06-28 12:40:59 +00:00
*[other] arguments
2023-05-23 01:51:25 +00:00
}
2022-06-28 12:40:59 +00:00
.add_fmt_suggestion = or add a "{"{"}{"}"}" format string to use the message literally
2024-07-17 10:35:50 +00:00
lint_non_glob_import_type_ir_inherent = non-glob import of `rustc_type_ir::inherent`
.suggestion = try using a glob import instead
2024-02-15 19:33:30 +00:00
lint_non_local_definitions_cargo_update = the {$macro_kind} `{$macro_name}` may come from an old version of the `{$crate_name}` crate, try updating your dependency with `cargo update -p {$crate_name}`
2024-01-26 14:25:18 +00:00
lint_non_local_definitions_deprecation = this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <https://github.com/rust-lang/rust/issues/120363>
2024-05-13 17:58:40 +00:00
lint_non_local_definitions_impl = non-local `impl` definition, `impl` blocks should be written at the same level as their item
2024-05-15 12:55:40 +00:00
.remove_help = remove `{$may_remove_part}` to make the `impl` local
2024-05-15 12:17:30 +00:00
.without_trait = methods and associated constants are still usable outside the current expression, only `impl Local` and `impl dyn Local` can ever be private, and only if the type is nested in the same item as the `impl`
2024-05-13 18:15:57 +00:00
.with_trait = an `impl` is never scoped, even when it is nested inside an item, as it may impact type checking outside of that item, which can be the case if neither the trait or the self type are at the same nesting level as the `impl`
.bounds = `impl` may be usable in bounds, etc. from outside the expression, which might e.g. make something constructible that previously wasn't, because it's still on a publicly-visible type
2024-06-13 15:08:04 +00:00
.doctest = make this doc-test a standalone test with its own `fn main() {"{"} ... {"}"}`
2024-06-19 00:04:40 +00:00
.exception = items in an anonymous const item (`const _: () = {"{"} ... {"}"}`) are treated as in the same scope as the anonymous const's declaration for the purpose of this lint
2024-02-15 19:30:16 +00:00
.const_anon = use a const-anon item to suppress this lint
2024-05-29 12:47:01 +00:00
.macro_to_change = the {$macro_kind} `{$macro_to_change}` defines the non-local `impl`, and may need to be changed
2024-01-26 14:25:18 +00:00
2024-05-18 13:07:28 +00:00
lint_non_local_definitions_impl_move_help =
move the `impl` block outside of this {$body_kind_descr} {$depth ->
[one] `{$body_name}`
*[other] `{$body_name}` and up {$depth} bodies
}
2024-05-13 17:58:40 +00:00
lint_non_local_definitions_macro_rules = non-local `macro_rules!` definition, `#[macro_export]` macro should be written at top level module
2024-01-26 14:25:18 +00:00
.help =
remove the `#[macro_export]` or move this `macro_rules!` outside the of the current {$body_kind_descr} {$depth ->
[one] `{$body_name}`
*[other] `{$body_name}` and up {$depth} bodies
}
2024-04-30 20:40:19 +00:00
.help_doctest =
remove the `#[macro_export]` or make this doc-test a standalone test with its own `fn main() {"{"} ... {"}"}`
2024-01-26 14:25:18 +00:00
.non_local = a `macro_rules!` definition is non-local if it is nested inside an item and has a `#[macro_export]` attribute
2024-05-14 10:41:27 +00:00
lint_non_local_definitions_may_move = may need to be moved as well
2024-05-15 17:13:02 +00:00
lint_non_local_definitions_of_trait_not_local = `{$of_trait_str}` is not local
lint_non_local_definitions_self_ty_not_local = `{$self_ty_str}` is not local
2022-08-10 07:42:10 +00:00
lint_non_snake_case = {$sort} `{$name}` should have a snake case name
.rename_or_convert_suggestion = rename the identifier or convert it to a snake case raw identifier
.cannot_convert_note = `{$sc}` cannot be used as a raw identifier
2022-06-28 12:40:59 +00:00
.rename_suggestion = rename the identifier
.convert_suggestion = convert the identifier to snake case
2022-08-10 07:42:10 +00:00
.help = convert the identifier to snake case: `{$sc}`
2022-06-28 12:40:59 +00:00
.label = should have a snake_case name
2022-06-28 12:45:49 +00:00
2022-08-10 07:42:10 +00:00
lint_non_upper_case_global = {$sort} `{$name}` should have an upper case name
2022-06-28 12:45:49 +00:00
.suggestion = convert the identifier to upper case
.label = should have an UPPER_CASE name
2022-06-28 12:50:44 +00:00
2022-08-10 07:42:10 +00:00
lint_noop_method_call = call to `.{$method}()` on a reference in this situation does nothing
2023-07-23 09:56:56 +00:00
.suggestion = remove this redundant call
2023-05-25 05:21:44 +00:00
.note = the type `{$orig_ty}` does not implement `{$trait_}`, so calling `{$method}` on `&{$orig_ty}` copies the reference, which does not do anything and can be removed
2024-02-22 18:01:12 +00:00
.derive_suggestion = if you meant to clone `{$orig_ty}`, implement `Clone` for it
2022-06-28 12:55:12 +00:00
2022-11-24 03:39:47 +00:00
lint_only_cast_u8_to_char = only `u8` can be cast into `char`
2022-12-21 03:13:28 +00:00
.suggestion = use a `char` literal instead
2022-11-22 21:15:27 +00:00
2022-08-10 07:42:10 +00:00
lint_opaque_hidden_inferred_bound = opaque type `{$ty}` does not satisfy its associated type bounds
2022-06-28 12:55:12 +00:00
.specifically = this associated type bound is unsatisfied for `{$proj_ty}`
2022-06-28 13:04:42 +00:00
2022-08-11 17:50:48 +00:00
lint_opaque_hidden_inferred_bound_sugg = add this bound
2024-04-15 18:07:22 +00:00
lint_or_patterns_back_compat = the meaning of the `pat` fragment specifier is changing in Rust 2021, which may affect this macro
.suggestion = use pat_param to preserve semantics
2024-06-18 13:45:50 +00:00
lint_out_of_scope_macro_calls = cannot find macro `{$path}` in this scope
.help = import `macro_rules` with `use` to make it callable above its definition
2022-08-11 17:50:48 +00:00
lint_overflowing_bin_hex = literal out of range for `{$ty}`
.negative_note = the literal `{$lit}` (decimal `{$dec}`) does not fit into the type `{$ty}`
.negative_becomes_note = and the value `-{$lit}` will become `{$actually}{$ty}`
.positive_note = the literal `{$lit}` (decimal `{$dec}`) does not fit into the type `{$ty}` and will become `{$actually}{$ty}`
.suggestion = consider using the type `{$suggestion_ty}` instead
2023-05-04 17:29:11 +00:00
.sign_bit_suggestion = to use as a negative number (decimal `{$negative_val}`), consider using the type `{$uint_ty}` for the literal and cast it to `{$int_ty}`
2022-08-11 17:50:48 +00:00
.help = consider using the type `{$suggestion_ty}` instead
2022-08-10 07:42:10 +00:00
lint_overflowing_int = literal out of range for `{$ty}`
.note = the literal `{$lit}` does not fit into the type `{$ty}` whose range is `{$min}..={$max}`
.help = consider using the type `{$suggestion_ty}` instead
2022-06-28 13:04:42 +00:00
2022-08-10 07:42:10 +00:00
lint_overflowing_literal = literal out of range for `{$ty}`
2022-06-28 13:04:42 +00:00
.note = the literal `{$lit}` does not fit into the type `{$ty}` and will be converted to `{$ty}::INFINITY`
2022-08-10 07:42:10 +00:00
lint_overflowing_uint = literal out of range for `{$ty}`
2022-06-28 13:04:42 +00:00
.note = the literal `{$lit}` does not fit into the type `{$ty}` whose range is `{$min}..={$max}`
2022-06-28 13:09:25 +00:00
2022-08-10 07:42:10 +00:00
lint_overruled_attribute = {$lint_level}({$lint_source}) incompatible with previous forbid
.label = overruled by previous forbid
2022-06-28 13:16:03 +00:00
2022-08-10 07:42:10 +00:00
lint_pass_by_value = passing `{$ty}` by reference
2022-06-28 13:16:03 +00:00
.suggestion = try passing by value
2022-06-28 13:20:10 +00:00
2022-08-10 07:42:10 +00:00
lint_path_statement_drop = path statement drops value
.suggestion = use `drop` to clarify the intent
2022-06-28 13:28:02 +00:00
2022-08-10 07:42:10 +00:00
lint_path_statement_no_effect = path statement with no effect
2022-06-28 13:32:38 +00:00
2024-04-14 17:59:54 +00:00
lint_pattern_in_bodiless = patterns aren't allowed in functions without bodies
.label = pattern not allowed in function without body
lint_pattern_in_foreign = patterns aren't allowed in foreign function declarations
.label = pattern not allowed in foreign function
2024-06-03 05:17:19 +00:00
lint_private_extern_crate_reexport = extern crate `{$ident}` is private and cannot be re-exported
.suggestion = consider making the `extern crate` item publicly accessible
2024-04-15 18:07:22 +00:00
lint_proc_macro_derive_resolution_fallback = cannot find {$ns} `{$ident}` in this scope
.label = names from parent modules are not accessible without an explicit import
2023-07-13 10:01:13 +00:00
lint_ptr_null_checks_fn_ptr = function pointers are not nullable, so checking them for null will always return false
.help = wrap the function pointer inside an `Option` and use `Option::is_none` to check for null pointer value
2023-08-03 08:57:11 +00:00
.label = expression has type `{$orig_ty}`
2023-07-13 10:01:13 +00:00
2023-08-05 23:25:24 +00:00
lint_ptr_null_checks_fn_ret = returned pointer of `{$fn_name}` call is never null, so checking it for null will always return false
2023-07-13 10:01:13 +00:00
lint_ptr_null_checks_ref = references are not nullable, so checking them for null will always return false
.label = expression has type `{$orig_ty}`
2022-08-10 07:42:10 +00:00
lint_query_instability = using `{$query}` can result in unstable query results
.note = if you believe this case to be fine, allow this lint and add a comment explaining your rationale
2022-06-28 13:40:11 +00:00
2022-08-10 07:42:10 +00:00
lint_range_endpoint_out_of_range = range endpoint is out of range for `{$ty}`
2022-06-28 14:08:34 +00:00
2023-04-17 07:16:07 +00:00
lint_range_use_inclusive_range = use an inclusive range instead
2022-11-13 14:46:31 +00:00
lint_reason_must_be_string_literal = reason must be a string literal
2022-06-28 14:12:35 +00:00
2022-08-10 07:42:10 +00:00
lint_reason_must_come_last = reason in lint attribute must come last
2022-06-28 14:16:49 +00:00
2024-04-15 18:07:22 +00:00
lint_redundant_import = the item `{$ident}` is imported redundantly
2024-04-11 18:10:34 +00:00
.label_imported_here = the item `{$ident}` is already imported here
.label_defined_here = the item `{$ident}` is already defined here
.label_imported_prelude = the item `{$ident}` is already imported by the extern prelude
.label_defined_prelude = the item `{$ident}` is already defined by the extern prelude
2024-04-15 18:07:22 +00:00
lint_redundant_import_visibility = glob import doesn't reexport anything with visibility `{$import_vis}` because no imported item is public enough
.note = the most public imported item is `{$max_vis}`
.help = reduce the glob import's visibility or increase visibility of imported items
2022-08-10 07:42:10 +00:00
lint_redundant_semicolons =
unnecessary trailing {$multiple ->
2022-06-27 16:02:46 +00:00
[true] semicolons
2022-08-10 07:42:10 +00:00
*[false] semicolon
2023-05-23 01:51:25 +00:00
}
2022-06-27 16:02:46 +00:00
.suggestion = remove {$multiple ->
[true] these semicolons
2022-08-10 07:42:10 +00:00
*[false] this semicolon
2023-05-23 01:51:25 +00:00
}
2022-08-19 19:50:38 +00:00
2024-04-15 18:07:22 +00:00
lint_remove_mut_from_pattern = remove `mut` from the parameter
2023-08-23 22:53:37 +00:00
lint_removed_lint = lint `{$name}` has been removed: {$reason}
lint_renamed_lint = lint `{$name}` has been renamed to `{$replace}`
2022-10-23 01:50:44 +00:00
.suggestion = use the new name
2023-08-23 22:53:37 +00:00
.help = use the new name `{$replace}`
2022-10-23 01:50:44 +00:00
lint_requested_level = requested on the command line with `{$level} {$lint_name}`
2024-04-15 18:07:22 +00:00
lint_reserved_prefix = prefix `{$prefix}` is unknown
.label = unknown prefix
.suggestion = insert whitespace here to avoid this being parsed as a prefix in Rust 2021
2024-04-17 20:32:17 +00:00
lint_shadowed_into_iter =
this method call resolves to `<&{$target} as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to `<{$target} as IntoIterator>::into_iter` in Rust {$edition}
.use_iter_suggestion = use `.iter()` instead of `.into_iter()` to avoid ambiguity
.remove_into_iter_suggestion = or remove `.into_iter()` to iterate by value
.use_explicit_into_iter_suggestion =
or use `IntoIterator::into_iter(..)` instead of `.into_iter()` to explicitly iterate by value
2024-04-15 18:07:22 +00:00
lint_single_use_lifetime = lifetime parameter `{$ident}` only used once
.label_param = this lifetime...
.label_use = ...is used only here
.suggestion = elide the single-use lifetime
2023-10-16 08:05:11 +00:00
lint_span_use_eq_ctxt = use `.eq_ctxt()` instead of `.ctxt() == .ctxt()`
2023-09-25 07:15:00 +00:00
2023-11-21 12:58:01 +00:00
lint_supertrait_as_deref_target = this `Deref` implementation is covered by an implicit supertrait coercion
2023-11-18 19:29:39 +00:00
.label = `{$self_ty}` implements `Deref<Target = dyn {$target_principal}>` which conflicts with supertrait `{$supertrait_principal}`
.label2 = target type is a supertrait of `{$self_ty}`
2023-11-21 12:58:01 +00:00
.help = consider removing this implementation or replacing it with a method instead
2022-11-25 01:03:06 +00:00
2023-06-11 08:18:56 +00:00
lint_suspicious_double_ref_clone =
using `.clone()` on a double reference, which returns `{$ty}` instead of cloning the inner type
lint_suspicious_double_ref_deref =
using `.deref()` on a double reference, which returns `{$ty}` instead of dereferencing the inner type
2022-08-20 00:47:05 +00:00
2024-04-15 18:07:22 +00:00
lint_trailing_semi_macro = trailing semicolon in macro used in expression position
.note1 = macro invocations at the end of a block are treated as expressions
.note2 = to ignore the value produced by the macro, add a semicolon after the invocation of `{$name}`
2022-08-20 00:47:05 +00:00
lint_ty_qualified = usage of qualified `ty::{$ty}`
.suggestion = try importing it and using it unqualified
lint_tykind = usage of `ty::TyKind`
.help = try using `Ty` instead
2022-08-19 21:17:14 +00:00
lint_tykind_kind = usage of `ty::TyKind::<kind>`
.suggestion = try using `ty::<kind>` directly
2023-05-12 17:30:15 +00:00
lint_undropped_manually_drops = calls to `std::mem::drop` with `std::mem::ManuallyDrop` instead of the inner value does nothing
.label = argument has type `{$arg_ty}`
.suggestion = use `std::mem::ManuallyDrop::into_inner` to get the inner value
2024-04-23 16:18:24 +00:00
lint_unexpected_cfg_add_build_rs_println = or consider adding `{$build_rs_println}` to the top of the `build.rs`
lint_unexpected_cfg_add_cargo_feature = consider using a Cargo feature instead
lint_unexpected_cfg_add_cargo_toml_lint_cfg = or consider adding in `Cargo.toml` the `check-cfg` lint config for the lint:{$cargo_toml_lint_cfg}
lint_unexpected_cfg_add_cmdline_arg = to expect this configuration use `{$cmdline_arg}`
lint_unexpected_cfg_define_features = consider defining some features in `Cargo.toml`
lint_unexpected_cfg_doc_cargo = see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
lint_unexpected_cfg_doc_rustc = see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
2024-04-15 18:07:22 +00:00
lint_unexpected_cfg_name = unexpected `cfg` condition name: `{$name}`
2024-04-23 16:18:24 +00:00
lint_unexpected_cfg_name_expected_names = expected names are: {$possibilities}{$and_more ->
[0] {""}
*[other] {" "}and {$and_more} more
}
lint_unexpected_cfg_name_expected_values = expected values for `{$best_match}` are: {$possibilities}
lint_unexpected_cfg_name_similar_name = there is a config with a similar name
lint_unexpected_cfg_name_similar_name_different_values = there is a config with a similar name and different values
lint_unexpected_cfg_name_similar_name_no_value = there is a config with a similar name and no value
lint_unexpected_cfg_name_similar_name_value = there is a config with a similar name and value
lint_unexpected_cfg_name_with_similar_value = found config with similar value
2024-04-15 18:07:22 +00:00
lint_unexpected_cfg_value = unexpected `cfg` condition value: {$has_value ->
[true] `{$value}`
*[false] (none)
}
2024-04-23 16:18:24 +00:00
lint_unexpected_cfg_value_add_feature = consider adding `{$value}` as a feature in `Cargo.toml`
lint_unexpected_cfg_value_expected_values = expected values for `{$name}` are: {$have_none_possibility ->
[true] {"(none), "}
*[false] {""}
}{$possibilities}{$and_more ->
[0] {""}
*[other] {" "}and {$and_more} more
}
lint_unexpected_cfg_value_no_expected_value = no expected value for `{$name}`
lint_unexpected_cfg_value_no_expected_values = no expected values for `{$name}`
lint_unexpected_cfg_value_remove_condition = remove the condition
lint_unexpected_cfg_value_remove_value = remove the value
lint_unexpected_cfg_value_similar_name = there is a expected value with a similar name
lint_unexpected_cfg_value_specify_value = specify a config value
2022-08-19 21:17:14 +00:00
lint_ungated_async_fn_track_caller = `#[track_caller]` on async functions is a no-op
.label = this function will not propagate the caller location
2024-04-15 18:07:22 +00:00
lint_unicode_text_flow = unicode codepoint changing visible direction of text present in comment
.label = {$num_codepoints ->
[1] this comment contains an invisible unicode text flow control codepoint
*[other] this comment contains invisible unicode text flow control codepoints
}
.note = these kind of unicode codepoints change the way text flows on applications that support them, but can cause confusion because they change the order of characters on the screen
.suggestion = if their presence wasn't intentional, you can remove them
.label_comment_char = {$c_debug}
2023-06-13 16:19:09 +00:00
lint_unit_bindings = binding has unit type `()`
.label = this pattern is inferred to be the unit type `()`
2024-04-15 18:07:22 +00:00
lint_unknown_diagnostic_attribute = unknown diagnostic attribute
lint_unknown_diagnostic_attribute_typo_sugg = an attribute with a similar name exists
2022-08-19 21:17:14 +00:00
lint_unknown_gated_lint =
unknown lint: `{$name}`
.note = the `{$name}` lint is unstable
lint_unknown_lint =
unknown lint: `{$name}`
2024-01-10 16:24:46 +00:00
.suggestion = {$from_rustc ->
[true] a lint with a similar name exists in `rustc` lints
*[false] did you mean
}
.help = {$from_rustc ->
[true] a lint with a similar name exists in `rustc` lints: `{$replace}`
*[false] did you mean: `{$replace}`
}
2022-08-19 21:17:14 +00:00
2024-04-15 18:07:22 +00:00
lint_unknown_macro_variable = unknown macro variable `{$name}`
2022-08-20 16:30:49 +00:00
lint_unknown_tool_in_scoped_lint = unknown tool name `{$tool_name}` found in scoped lint: `{$tool_name}::{$lint_name}`
2022-08-19 19:50:38 +00:00
.help = add `#![register_tool({$tool_name})]` to the crate root
2022-08-20 19:48:03 +00:00
2024-04-14 20:11:14 +00:00
lint_unnameable_test_items = cannot test inner items
2024-04-15 18:07:22 +00:00
lint_unnecessary_qualification = unnecessary qualification
.suggestion = remove the unnecessary path segments
2024-06-08 23:39:09 +00:00
lint_unsafe_attr_outside_unsafe = unsafe attribute used without unsafe
.label = usage of unsafe attribute
lint_unsafe_attr_outside_unsafe_suggestion = wrap the attribute in `unsafe(...)`
2022-08-20 19:48:03 +00:00
lint_unsupported_group = `{$lint_group}` lint group is not supported with ´ --force-warn´
lint_untranslatable_diag = diagnostics should be created using translatable messages
lint_unused_allocation = unnecessary allocation, use `&` instead
lint_unused_allocation_mut = unnecessary allocation, use `&mut` instead
2024-04-15 18:07:22 +00:00
lint_unused_builtin_attribute = unused attribute `{$attr_name}`
.note = the built-in attribute `{$attr_name}` will be ignored, since it's applied to the macro invocation `{$macro_name}`
2022-08-20 19:48:03 +00:00
lint_unused_closure =
unused {$pre}{$count ->
2022-06-28 09:14:10 +00:00
[one] closure
2022-08-20 19:48:03 +00:00
*[other] closures
}{$post} that must be used
.note = closures are lazy and do nothing unless called
lint_unused_comparisons = comparison is useless due to type limits
2023-10-19 21:46:28 +00:00
lint_unused_coroutine =
unused {$pre}{$count ->
[one] coroutine
*[other] coroutine
}{$post} that must be used
.note = coroutines are lazy and do nothing unless resumed
2024-06-03 05:17:19 +00:00
lint_unused_crate_dependency = extern crate `{$extern_crate}` is unused in crate `{$local_crate}`
.help = remove the dependency or add `use {$extern_crate} as _;` to the crate root
2024-04-15 18:07:22 +00:00
2022-08-20 19:48:03 +00:00
lint_unused_def = unused {$pre}`{$def}`{$post} that must be used
.suggestion = use `let _ = ...` to ignore the resulting value
2022-10-02 04:45:54 +00:00
2022-10-02 05:45:15 +00:00
lint_unused_delim = unnecessary {$delim} around {$item}
2022-10-02 04:45:54 +00:00
.suggestion = remove these {$delim}
2022-10-05 19:46:40 +00:00
2024-04-15 18:07:22 +00:00
lint_unused_doc_comment = unused doc comment
.label = rustdoc does not generate documentation for macro invocations
.help = to document an item produced by a macro, the macro must produce the documentation as part of its expansion
lint_unused_extern_crate = unused extern crate
.suggestion = remove it
2023-05-19 09:25:35 +00:00
lint_unused_import_braces = braces around {$node} is unnecessary
2023-03-27 18:59:59 +00:00
2024-04-15 18:07:22 +00:00
lint_unused_imports = {$num_snippets ->
[one] unused import: {$span_snippets}
*[other] unused imports: {$span_snippets}
}
.suggestion_remove_whole_use = remove the whole `use` item
.suggestion_remove_imports = {$num_to_remove ->
[one] remove the unused import
*[other] remove the unused imports
}
.help = if this is a test module, consider adding a `#[cfg(test)]` to the containing module
lint_unused_label = unused label
lint_unused_lifetime = lifetime parameter `{$ident}` never used
.suggestion = elide the unused lifetime
lint_unused_macro_definition = unused macro definition: `{$name}`
lint_unused_macro_use = unused `#[macro_use]` import
2023-05-19 09:14:55 +00:00
lint_unused_op = unused {$op} that must be used
2023-04-10 09:55:37 +00:00
.label = the {$op} produces a value
2023-04-14 20:20:27 +00:00
.suggestion = use `let _ = ...` to ignore the resulting value
2023-03-28 16:31:21 +00:00
2023-05-19 09:30:11 +00:00
lint_unused_result = unused result of type `{$ty}`
2023-03-28 16:47:37 +00:00
2024-05-25 03:44:14 +00:00
lint_use_let_underscore_ignore_suggestion = use `let _ = ...` to ignore the expression or result
2023-05-19 09:19:31 +00:00
lint_variant_size_differences =
enum variant is more than three times larger ({$largest} bytes) than the next largest
2024-04-14 20:11:14 +00:00
lint_wasm_c_abi =
older versions of the `wasm-bindgen` crate will be incompatible with future versions of Rust; please update to `wasm-bindgen` v0.2.88