blob: 266109765ab8c496d8addd1ae28ebc4a93f3c6af [file] [log] [blame]
//! Generated by `cargo codegen lint-definitions`, do not edit by hand.
#[derive(Clone)]
pub struct Lint {
pub label: &'static str,
pub description: &'static str,
}
pub struct LintGroup {
pub lint: Lint,
pub children: &'static [&'static str],
}
pub const DEFAULT_LINTS: &[Lint] = &[
Lint {
label: "absolute_paths_not_starting_with_crate",
description: r##"fully qualified paths that start with a module name instead of `crate`, `self`, or an extern crate name"##,
},
Lint { label: "ambiguous_associated_items", description: r##"ambiguous associated items"## },
Lint {
label: "ambiguous_glob_imports",
description: r##"detects certain glob imports that require reporting an ambiguity error"##,
},
Lint { label: "ambiguous_glob_reexports", description: r##"ambiguous glob re-exports"## },
Lint {
label: "ambiguous_wide_pointer_comparisons",
description: r##"detects ambiguous wide pointer comparisons"##,
},
Lint { label: "anonymous_parameters", description: r##"detects anonymous parameters"## },
Lint { label: "arithmetic_overflow", description: r##"arithmetic operation overflows"## },
Lint {
label: "array_into_iter",
description: r##"detects calling `into_iter` on arrays in Rust 2015 and 2018"##,
},
Lint {
label: "asm_sub_register",
description: r##"using only a subset of a register for inline asm inputs"##,
},
Lint {
label: "async_fn_in_trait",
description: r##"use of `async fn` in definition of a publicly-reachable trait"##,
},
Lint { label: "bad_asm_style", description: r##"incorrect use of inline assembly"## },
Lint {
label: "bare_trait_objects",
description: r##"suggest using `dyn Trait` for trait objects"##,
},
Lint {
label: "bindings_with_variant_name",
description: r##"detects pattern bindings with the same name as one of the matched variants"##,
},
Lint {
label: "boxed_slice_into_iter",
description: r##"detects calling `into_iter` on boxed slices in Rust 2015, 2018, and 2021"##,
},
Lint {
label: "break_with_label_and_loop",
description: r##"`break` expression with label and unlabeled loop as value expression"##,
},
Lint {
label: "byte_slice_in_packed_struct_with_derive",
description: r##"`[u8]` or `str` used in a packed struct with `derive`"##,
},
Lint {
label: "cenum_impl_drop_cast",
description: r##"a C-like enum implementing Drop is cast"##,
},
Lint {
label: "clashing_extern_declarations",
description: r##"detects when an extern fn has been declared with the same name but different types"##,
},
Lint {
label: "coherence_leak_check",
description: r##"distinct impls distinguished only by the leak-check code"##,
},
Lint {
label: "conflicting_repr_hints",
description: r##"conflicts between `#[repr(..)]` hints that were previously accepted and used in practice"##,
},
Lint {
label: "confusable_idents",
description: r##"detects visually confusable pairs between identifiers"##,
},
Lint {
label: "const_eval_mutable_ptr_in_final_value",
description: r##"detects a mutable pointer that has leaked into final value of a const expression"##,
},
Lint {
label: "const_evaluatable_unchecked",
description: r##"detects a generic constant is used in a type without a emitting a warning"##,
},
Lint {
label: "const_item_mutation",
description: r##"detects attempts to mutate a `const` item"##,
},
Lint { label: "dead_code", description: r##"detect unused, unexported items"## },
Lint {
label: "dependency_on_unit_never_type_fallback",
description: r##"never type fallback affecting unsafe function calls"##,
},
Lint { label: "deprecated", description: r##"detects use of deprecated items"## },
Lint {
label: "deprecated_cfg_attr_crate_type_name",
description: r##"detects usage of `#![cfg_attr(..., crate_type/crate_name = "...")]`"##,
},
Lint {
label: "deprecated_in_future",
description: r##"detects use of items that will be deprecated in a future version"##,
},
Lint {
label: "deprecated_safe",
description: r##"detects unsafe functions being used as safe functions"##,
},
Lint {
label: "deprecated_where_clause_location",
description: r##"deprecated where clause location"##,
},
Lint {
label: "deref_into_dyn_supertrait",
description: r##"`Deref` implementation usage with a supertrait trait object for output might be shadowed in the future"##,
},
Lint {
label: "deref_nullptr",
description: r##"detects when an null pointer is dereferenced"##,
},
Lint {
label: "drop_bounds",
description: r##"bounds of the form `T: Drop` are most likely incorrect"##,
},
Lint {
label: "dropping_copy_types",
description: r##"calls to `std::mem::drop` with a value that implements Copy"##,
},
Lint {
label: "dropping_references",
description: r##"calls to `std::mem::drop` with a reference instead of an owned value"##,
},
Lint { label: "duplicate_macro_attributes", description: r##"duplicated attribute"## },
Lint {
label: "dyn_drop",
description: r##"trait objects of the form `dyn Drop` are useless"##,
},
Lint {
label: "elided_lifetimes_in_associated_constant",
description: r##"elided lifetimes cannot be used in associated constants in impls"##,
},
Lint {
label: "elided_lifetimes_in_paths",
description: r##"hidden lifetime parameters in types are deprecated"##,
},
Lint {
label: "ellipsis_inclusive_range_patterns",
description: r##"`...` range patterns are deprecated"##,
},
Lint {
label: "enum_intrinsics_non_enums",
description: r##"detects calls to `core::mem::discriminant` and `core::mem::variant_count` with non-enum types"##,
},
Lint {
label: "explicit_outlives_requirements",
description: r##"outlives requirements can be inferred"##,
},
Lint {
label: "exported_private_dependencies",
description: r##"public interface leaks type from a private dependency"##,
},
Lint {
label: "ffi_unwind_calls",
description: r##"call to foreign functions or function pointers with FFI-unwind ABI"##,
},
Lint {
label: "for_loops_over_fallibles",
description: r##"for-looping over an `Option` or a `Result`, which is more clearly expressed as an `if let`"##,
},
Lint { label: "forbidden_lint_groups", description: r##"applying forbid to lint-groups"## },
Lint {
label: "forgetting_copy_types",
description: r##"calls to `std::mem::forget` with a value that implements Copy"##,
},
Lint {
label: "forgetting_references",
description: r##"calls to `std::mem::forget` with a reference instead of an owned value"##,
},
Lint {
label: "function_item_references",
description: r##"suggest casting to a function pointer when attempting to take references to function items"##,
},
Lint {
label: "future_incompatible",
description: r##"lint group for: deref-into-dyn-supertrait, ambiguous-associated-items, ambiguous-glob-imports, byte-slice-in-packed-struct-with-derive, cenum-impl-drop-cast, coherence-leak-check, conflicting-repr-hints, const-eval-mutable-ptr-in-final-value, const-evaluatable-unchecked, dependency-on-unit-never-type-fallback, deprecated-cfg-attr-crate-type-name, elided-lifetimes-in-associated-constant, forbidden-lint-groups, ill-formed-attribute-input, invalid-type-param-default, late-bound-lifetime-arguments, legacy-derive-helpers, macro-expanded-macro-exports-accessed-by-absolute-paths, missing-fragment-specifier, never-type-fallback-flowing-into-unsafe, order-dependent-trait-objects, out-of-scope-macro-calls, patterns-in-fns-without-body, proc-macro-derive-resolution-fallback, pub-use-of-private-extern-crate, repr-transparent-external-private-fields, self-constructor-from-outer-item, semicolon-in-expressions-from-macros, soft-unstable, uncovered-param-in-projection, uninhabited-static, unstable-name-collisions, unstable-syntax-pre-expansion, unsupported-calling-conventions, wasm-c-abi, writes-through-immutable-pointer"##,
},
Lint {
label: "fuzzy_provenance_casts",
description: r##"a fuzzy integer to pointer cast is used"##,
},
Lint {
label: "hidden_glob_reexports",
description: r##"name introduced by a private item shadows a name introduced by a public glob re-export"##,
},
Lint {
label: "ill_formed_attribute_input",
description: r##"ill-formed attribute inputs that were previously accepted and used in practice"##,
},
Lint {
label: "impl_trait_overcaptures",
description: r##"`impl Trait` will capture more lifetimes than possibly intended in edition 2024"##,
},
Lint {
label: "impl_trait_redundant_captures",
description: r##"redundant precise-capturing `use<...>` syntax on an `impl Trait`"##,
},
Lint {
label: "improper_ctypes",
description: r##"proper use of libc types in foreign modules"##,
},
Lint {
label: "improper_ctypes_definitions",
description: r##"proper use of libc types in foreign item definitions"##,
},
Lint {
label: "incomplete_features",
description: r##"incomplete features that may function improperly in some or all cases"##,
},
Lint { label: "incomplete_include", description: r##"trailing content in included file"## },
Lint {
label: "ineffective_unstable_trait_impl",
description: r##"detects `#[unstable]` on stable trait implementations for stable types"##,
},
Lint {
label: "inline_no_sanitize",
description: r##"detects incompatible use of `#[inline(always)]` and `#[no_sanitize(...)]`"##,
},
Lint {
label: "internal_features",
description: r##"internal features are not supposed to be used"##,
},
Lint {
label: "invalid_atomic_ordering",
description: r##"usage of invalid atomic ordering in atomic operations and memory fences"##,
},
Lint {
label: "invalid_doc_attributes",
description: r##"detects invalid `#[doc(...)]` attributes"##,
},
Lint {
label: "invalid_from_utf8",
description: r##"using a non UTF-8 literal in `std::str::from_utf8`"##,
},
Lint {
label: "invalid_from_utf8_unchecked",
description: r##"using a non UTF-8 literal in `std::str::from_utf8_unchecked`"##,
},
Lint {
label: "invalid_macro_export_arguments",
description: r##""invalid_parameter" isn't a valid argument for `#[macro_export]`"##,
},
Lint {
label: "invalid_nan_comparisons",
description: r##"detects invalid floating point NaN comparisons"##,
},
Lint {
label: "invalid_reference_casting",
description: r##"casts of `&T` to `&mut T` without interior mutability"##,
},
Lint {
label: "invalid_type_param_default",
description: r##"type parameter default erroneously allowed in invalid location"##,
},
Lint {
label: "invalid_value",
description: r##"an invalid value is being created (such as a null reference)"##,
},
Lint {
label: "irrefutable_let_patterns",
description: r##"detects irrefutable patterns in `if let` and `while let` statements"##,
},
Lint {
label: "keyword_idents",
description: r##"lint group for: keyword-idents-2018, keyword-idents-2024"##,
},
Lint {
label: "keyword_idents_2018",
description: r##"detects edition keywords being used as an identifier"##,
},
Lint {
label: "keyword_idents_2024",
description: r##"detects edition keywords being used as an identifier"##,
},
Lint { label: "large_assignments", description: r##"detects large moves or copies"## },
Lint {
label: "late_bound_lifetime_arguments",
description: r##"detects generic lifetime arguments in path segments with late bound lifetime parameters"##,
},
Lint {
label: "legacy_derive_helpers",
description: r##"detects derive helper attributes that are used before they are introduced"##,
},
Lint {
label: "let_underscore",
description: r##"lint group for: let-underscore-drop, let-underscore-lock"##,
},
Lint {
label: "let_underscore_drop",
description: r##"non-binding let on a type that implements `Drop`"##,
},
Lint {
label: "let_underscore_lock",
description: r##"non-binding let on a synchronization lock"##,
},
Lint {
label: "long_running_const_eval",
description: r##"detects long const eval operations"##,
},
Lint {
label: "lossy_provenance_casts",
description: r##"a lossy pointer to integer cast is used"##,
},
Lint {
label: "macro_expanded_macro_exports_accessed_by_absolute_paths",
description: r##"macro-expanded `macro_export` macros from the current crate cannot be referred to by absolute paths"##,
},
Lint {
label: "macro_use_extern_crate",
description: r##"the `#[macro_use]` attribute is now deprecated in favor of using macros via the module system"##,
},
Lint {
label: "map_unit_fn",
description: r##"`Iterator::map` call that discard the iterator's values"##,
},
Lint {
label: "meta_variable_misuse",
description: r##"possible meta-variable misuse at macro definition"##,
},
Lint { label: "missing_abi", description: r##"No declared ABI for extern declaration"## },
Lint {
label: "missing_copy_implementations",
description: r##"detects potentially-forgotten implementations of `Copy`"##,
},
Lint {
label: "missing_debug_implementations",
description: r##"detects missing implementations of Debug"##,
},
Lint {
label: "missing_docs",
description: r##"detects missing documentation for public members"##,
},
Lint {
label: "missing_fragment_specifier",
description: r##"detects missing fragment specifiers in unused `macro_rules!` patterns"##,
},
Lint {
label: "missing_unsafe_on_extern",
description: r##"detects missing unsafe keyword on extern declarations"##,
},
Lint {
label: "mixed_script_confusables",
description: r##"detects Unicode scripts whose mixed script confusables codepoints are solely used"##,
},
Lint {
label: "multiple_supertrait_upcastable",
description: r##"detect when an object-safe trait has multiple supertraits"##,
},
Lint {
label: "must_not_suspend",
description: r##"use of a `#[must_not_suspend]` value across a yield point"##,
},
Lint {
label: "mutable_transmutes",
description: r##"transmuting &T to &mut T is undefined behavior, even if the reference is unused"##,
},
Lint {
label: "named_arguments_used_positionally",
description: r##"named arguments in format used positionally"##,
},
Lint { label: "named_asm_labels", description: r##"named labels in inline assembly"## },
Lint {
label: "never_type_fallback_flowing_into_unsafe",
description: r##"never type fallback affecting unsafe function calls"##,
},
Lint {
label: "no_mangle_const_items",
description: r##"const items will not have their symbols exported"##,
},
Lint { label: "no_mangle_generic_items", description: r##"generic items must be mangled"## },
Lint { label: "non_ascii_idents", description: r##"detects non-ASCII identifiers"## },
Lint {
label: "non_camel_case_types",
description: r##"types, variants, traits and type parameters should have camel case names"##,
},
Lint {
label: "non_contiguous_range_endpoints",
description: r##"detects off-by-one errors with exclusive range patterns"##,
},
Lint {
label: "non_exhaustive_omitted_patterns",
description: r##"detect when patterns of types marked `non_exhaustive` are missed"##,
},
Lint {
label: "non_fmt_panics",
description: r##"detect single-argument panic!() invocations in which the argument is not a format string"##,
},
Lint { label: "non_local_definitions", description: r##"checks for non-local definitions"## },
Lint {
label: "non_shorthand_field_patterns",
description: r##"using `Struct { x: x }` instead of `Struct { x }` in a pattern"##,
},
Lint {
label: "non_snake_case",
description: r##"variables, methods, functions, lifetime parameters and modules should have snake case names"##,
},
Lint {
label: "non_upper_case_globals",
description: r##"static constants should have uppercase identifiers"##,
},
Lint {
label: "nonstandard_style",
description: r##"lint group for: non-camel-case-types, non-snake-case, non-upper-case-globals"##,
},
Lint {
label: "noop_method_call",
description: r##"detects the use of well-known noop methods"##,
},
Lint {
label: "opaque_hidden_inferred_bound",
description: r##"detects the use of nested `impl Trait` types in associated type bounds that are not general enough"##,
},
Lint {
label: "order_dependent_trait_objects",
description: r##"trait-object types were treated as different depending on marker-trait order"##,
},
Lint {
label: "out_of_scope_macro_calls",
description: r##"detects out of scope calls to `macro_rules` in key-value attributes"##,
},
Lint { label: "overflowing_literals", description: r##"literal out of range for its type"## },
Lint {
label: "overlapping_range_endpoints",
description: r##"detects range patterns with overlapping endpoints"##,
},
Lint { label: "path_statements", description: r##"path statements with no effect"## },
Lint {
label: "patterns_in_fns_without_body",
description: r##"patterns in functions without body were erroneously allowed"##,
},
Lint {
label: "private_bounds",
description: r##"private type in secondary interface of an item"##,
},
Lint {
label: "private_interfaces",
description: r##"private type in primary interface of an item"##,
},
Lint {
label: "proc_macro_derive_resolution_fallback",
description: r##"detects proc macro derives using inaccessible names from parent modules"##,
},
Lint {
label: "pub_use_of_private_extern_crate",
description: r##"detect public re-exports of private extern crates"##,
},
Lint {
label: "redundant_lifetimes",
description: r##"detects lifetime parameters that are redundant because they are equal to some other named lifetime"##,
},
Lint {
label: "redundant_semicolons",
description: r##"detects unnecessary trailing semicolons"##,
},
Lint {
label: "refining_impl_trait",
description: r##"lint group for: refining-impl-trait-reachable, refining-impl-trait-internal"##,
},
Lint {
label: "refining_impl_trait_internal",
description: r##"impl trait in impl method signature does not match trait method signature"##,
},
Lint {
label: "refining_impl_trait_reachable",
description: r##"impl trait in impl method signature does not match trait method signature"##,
},
Lint {
label: "renamed_and_removed_lints",
description: r##"lints that have been renamed or removed"##,
},
Lint {
label: "repr_transparent_external_private_fields",
description: r##"transparent type contains an external ZST that is marked #[non_exhaustive] or contains private fields"##,
},
Lint {
label: "rust_2018_compatibility",
description: r##"lint group for: keyword-idents-2018, anonymous-parameters, absolute-paths-not-starting-with-crate, tyvar-behind-raw-pointer"##,
},
Lint {
label: "rust_2018_idioms",
description: r##"lint group for: bare-trait-objects, unused-extern-crates, ellipsis-inclusive-range-patterns, elided-lifetimes-in-paths, explicit-outlives-requirements"##,
},
Lint {
label: "rust_2021_compatibility",
description: r##"lint group for: ellipsis-inclusive-range-patterns, bare-trait-objects, rust-2021-incompatible-closure-captures, rust-2021-incompatible-or-patterns, rust-2021-prefixes-incompatible-syntax, rust-2021-prelude-collisions, array-into-iter, non-fmt-panics"##,
},
Lint {
label: "rust_2021_incompatible_closure_captures",
description: r##"detects closures affected by Rust 2021 changes"##,
},
Lint {
label: "rust_2021_incompatible_or_patterns",
description: r##"detects usage of old versions of or-patterns"##,
},
Lint {
label: "rust_2021_prefixes_incompatible_syntax",
description: r##"identifiers that will be parsed as a prefix in Rust 2021"##,
},
Lint {
label: "rust_2021_prelude_collisions",
description: r##"detects the usage of trait methods which are ambiguous with traits added to the prelude in future editions"##,
},
Lint {
label: "rust_2024_compatibility",
description: r##"lint group for: keyword-idents-2024, deprecated-safe, missing-unsafe-on-extern, static-mut-refs, unsafe-attr-outside-unsafe, unsafe-op-in-unsafe-fn, boxed-slice-into-iter"##,
},
Lint {
label: "rust_2024_incompatible_pat",
description: r##"detects patterns whose meaning will change in Rust 2024"##,
},
Lint {
label: "self_constructor_from_outer_item",
description: r##"detect unsupported use of `Self` from outer item"##,
},
Lint {
label: "semicolon_in_expressions_from_macros",
description: r##"trailing semicolon in macro body used as expression"##,
},
Lint {
label: "single_use_lifetimes",
description: r##"detects lifetime parameters that are only used once"##,
},
Lint {
label: "soft_unstable",
description: r##"a feature gate that doesn't break dependent crates"##,
},
Lint {
label: "special_module_name",
description: r##"module declarations for files with a special meaning"##,
},
Lint {
label: "stable_features",
description: r##"stable features found in `#[feature]` directive"##,
},
Lint {
label: "static_mut_refs",
description: r##"shared references or mutable references of mutable static is discouraged"##,
},
Lint {
label: "suspicious_double_ref_op",
description: r##"suspicious call of trait method on `&&T`"##,
},
Lint {
label: "temporary_cstring_as_ptr",
description: r##"detects getting the inner pointer of a temporary `CString`"##,
},
Lint {
label: "test_unstable_lint",
description: r##"this unstable lint is only for testing"##,
},
Lint {
label: "text_direction_codepoint_in_comment",
description: r##"invisible directionality-changing codepoints in comment"##,
},
Lint {
label: "text_direction_codepoint_in_literal",
description: r##"detect special Unicode codepoints that affect the visual representation of text on screen, changing the direction in which text flows"##,
},
Lint {
label: "trivial_bounds",
description: r##"these bounds don't depend on an type parameters"##,
},
Lint {
label: "trivial_casts",
description: r##"detects trivial casts which could be removed"##,
},
Lint {
label: "trivial_numeric_casts",
description: r##"detects trivial casts of numeric types which could be removed"##,
},
Lint {
label: "type_alias_bounds",
description: r##"bounds in type aliases are not enforced"##,
},
Lint {
label: "tyvar_behind_raw_pointer",
description: r##"raw pointer to an inference variable"##,
},
Lint {
label: "uncommon_codepoints",
description: r##"detects uncommon Unicode codepoints in identifiers"##,
},
Lint {
label: "unconditional_panic",
description: r##"operation will cause a panic at runtime"##,
},
Lint {
label: "unconditional_recursion",
description: r##"functions that cannot return without calling themselves"##,
},
Lint {
label: "uncovered_param_in_projection",
description: r##"impl contains type parameters that are not covered"##,
},
Lint {
label: "undefined_naked_function_abi",
description: r##"undefined naked function ABI"##,
},
Lint {
label: "undropped_manually_drops",
description: r##"calls to `std::mem::drop` with `std::mem::ManuallyDrop` instead of it's inner value"##,
},
Lint {
label: "unexpected_cfgs",
description: r##"detects unexpected names and values in `#[cfg]` conditions"##,
},
Lint {
label: "unfulfilled_lint_expectations",
description: r##"unfulfilled lint expectation"##,
},
Lint {
label: "ungated_async_fn_track_caller",
description: r##"enabling track_caller on an async fn is a no-op unless the async_fn_track_caller feature is enabled"##,
},
Lint { label: "uninhabited_static", description: r##"uninhabited static"## },
Lint {
label: "unit_bindings",
description: r##"binding is useless because it has the unit `()` type"##,
},
Lint {
label: "unknown_crate_types",
description: r##"unknown crate type found in `#[crate_type]` directive"##,
},
Lint { label: "unknown_lints", description: r##"unrecognized lint attribute"## },
Lint {
label: "unknown_or_malformed_diagnostic_attributes",
description: r##"unrecognized or malformed diagnostic attribute"##,
},
Lint {
label: "unnameable_test_items",
description: r##"detects an item that cannot be named being marked as `#[test_case]`"##,
},
Lint {
label: "unnameable_types",
description: r##"effective visibility of a type is larger than the area in which it can be named"##,
},
Lint { label: "unreachable_code", description: r##"detects unreachable code paths"## },
Lint { label: "unreachable_patterns", description: r##"detects unreachable patterns"## },
Lint {
label: "unreachable_pub",
description: r##"`pub` items not reachable from crate root"##,
},
Lint {
label: "unsafe_attr_outside_unsafe",
description: r##"detects unsafe attributes outside of unsafe"##,
},
Lint {
label: "unsafe_code",
description: r##"usage of `unsafe` code and other potentially unsound constructs"##,
},
Lint {
label: "unsafe_op_in_unsafe_fn",
description: r##"unsafe operations in unsafe functions without an explicit unsafe block are deprecated"##,
},
Lint { label: "unstable_features", description: r##"enabling unstable features"## },
Lint {
label: "unstable_name_collisions",
description: r##"detects name collision with an existing but unstable method"##,
},
Lint {
label: "unstable_syntax_pre_expansion",
description: r##"unstable syntax can change at any point in the future, causing a hard error!"##,
},
Lint {
label: "unsupported_calling_conventions",
description: r##"use of unsupported calling convention"##,
},
Lint {
label: "unused",
description: r##"lint group for: unused-imports, unused-variables, unused-assignments, dead-code, unused-mut, unreachable-code, unreachable-patterns, unused-must-use, unused-unsafe, path-statements, unused-attributes, unused-macros, unused-macro-rules, unused-allocation, unused-doc-comments, unused-extern-crates, unused-features, unused-labels, unused-parens, unused-braces, redundant-semicolons, map-unit-fn"##,
},
Lint {
label: "unused_allocation",
description: r##"detects unnecessary allocations that can be eliminated"##,
},
Lint {
label: "unused_assignments",
description: r##"detect assignments that will never be read"##,
},
Lint {
label: "unused_associated_type_bounds",
description: r##"detects unused `Foo = Bar` bounds in `dyn Trait<Foo = Bar>`"##,
},
Lint {
label: "unused_attributes",
description: r##"detects attributes that were not used by the compiler"##,
},
Lint { label: "unused_braces", description: r##"unnecessary braces around an expression"## },
Lint {
label: "unused_comparisons",
description: r##"comparisons made useless by limits of the types involved"##,
},
Lint {
label: "unused_crate_dependencies",
description: r##"crate dependencies that are never used"##,
},
Lint {
label: "unused_doc_comments",
description: r##"detects doc comments that aren't used by rustdoc"##,
},
Lint { label: "unused_extern_crates", description: r##"extern crates that are never used"## },
Lint {
label: "unused_features",
description: r##"unused features found in crate-level `#[feature]` directives"##,
},
Lint {
label: "unused_import_braces",
description: r##"unnecessary braces around an imported item"##,
},
Lint { label: "unused_imports", description: r##"imports that are never used"## },
Lint { label: "unused_labels", description: r##"detects labels that are never used"## },
Lint {
label: "unused_lifetimes",
description: r##"detects lifetime parameters that are never used"##,
},
Lint {
label: "unused_macro_rules",
description: r##"detects macro rules that were not used"##,
},
Lint { label: "unused_macros", description: r##"detects macros that were not used"## },
Lint {
label: "unused_must_use",
description: r##"unused result of a type flagged as `#[must_use]`"##,
},
Lint {
label: "unused_mut",
description: r##"detect mut variables which don't need to be mutable"##,
},
Lint {
label: "unused_parens",
description: r##"`if`, `match`, `while` and `return` do not need parentheses"##,
},
Lint {
label: "unused_qualifications",
description: r##"detects unnecessarily qualified names"##,
},
Lint {
label: "unused_results",
description: r##"unused result of an expression in a statement"##,
},
Lint { label: "unused_unsafe", description: r##"unnecessary use of an `unsafe` block"## },
Lint {
label: "unused_variables",
description: r##"detect variables which are not used in any way"##,
},
Lint {
label: "useless_deprecated",
description: r##"detects deprecation attributes with no effect"##,
},
Lint {
label: "useless_ptr_null_checks",
description: r##"useless checking of non-null-typed pointer"##,
},
Lint {
label: "variant_size_differences",
description: r##"detects enums with widely varying variant sizes"##,
},
Lint {
label: "warnings",
description: r##"mass-change the level for lints which produce warnings"##,
},
Lint {
label: "warnings",
description: r##"lint group for: all lints that are set to issue warnings"##,
},
Lint {
label: "wasm_c_abi",
description: r##"detects dependencies that are incompatible with the Wasm C ABI"##,
},
Lint {
label: "while_true",
description: r##"suggest using `loop { }` instead of `while true { }`"##,
},
Lint {
label: "writes_through_immutable_pointer",
description: r##"shared references are immutable, and pointers derived from them must not be written to"##,
},
];
pub const DEFAULT_LINT_GROUPS: &[LintGroup] = &[
LintGroup {
lint: Lint {
label: "future_incompatible",
description: r##"lint group for: deref-into-dyn-supertrait, ambiguous-associated-items, ambiguous-glob-imports, byte-slice-in-packed-struct-with-derive, cenum-impl-drop-cast, coherence-leak-check, conflicting-repr-hints, const-eval-mutable-ptr-in-final-value, const-evaluatable-unchecked, dependency-on-unit-never-type-fallback, deprecated-cfg-attr-crate-type-name, elided-lifetimes-in-associated-constant, forbidden-lint-groups, ill-formed-attribute-input, invalid-type-param-default, late-bound-lifetime-arguments, legacy-derive-helpers, macro-expanded-macro-exports-accessed-by-absolute-paths, missing-fragment-specifier, never-type-fallback-flowing-into-unsafe, order-dependent-trait-objects, out-of-scope-macro-calls, patterns-in-fns-without-body, proc-macro-derive-resolution-fallback, pub-use-of-private-extern-crate, repr-transparent-external-private-fields, self-constructor-from-outer-item, semicolon-in-expressions-from-macros, soft-unstable, uncovered-param-in-projection, uninhabited-static, unstable-name-collisions, unstable-syntax-pre-expansion, unsupported-calling-conventions, wasm-c-abi, writes-through-immutable-pointer"##,
},
children: &[
"deref_into_dyn_supertrait",
"ambiguous_associated_items",
"ambiguous_glob_imports",
"byte_slice_in_packed_struct_with_derive",
"cenum_impl_drop_cast",
"coherence_leak_check",
"conflicting_repr_hints",
"const_eval_mutable_ptr_in_final_value",
"const_evaluatable_unchecked",
"dependency_on_unit_never_type_fallback",
"deprecated_cfg_attr_crate_type_name",
"elided_lifetimes_in_associated_constant",
"forbidden_lint_groups",
"ill_formed_attribute_input",
"invalid_type_param_default",
"late_bound_lifetime_arguments",
"legacy_derive_helpers",
"macro_expanded_macro_exports_accessed_by_absolute_paths",
"missing_fragment_specifier",
"never_type_fallback_flowing_into_unsafe",
"order_dependent_trait_objects",
"out_of_scope_macro_calls",
"patterns_in_fns_without_body",
"proc_macro_derive_resolution_fallback",
"pub_use_of_private_extern_crate",
"repr_transparent_external_private_fields",
"self_constructor_from_outer_item",
"semicolon_in_expressions_from_macros",
"soft_unstable",
"uncovered_param_in_projection",
"uninhabited_static",
"unstable_name_collisions",
"unstable_syntax_pre_expansion",
"unsupported_calling_conventions",
"wasm_c_abi",
"writes_through_immutable_pointer",
],
},
LintGroup {
lint: Lint {
label: "keyword_idents",
description: r##"lint group for: keyword-idents-2018, keyword-idents-2024"##,
},
children: &["keyword_idents_2018", "keyword_idents_2024"],
},
LintGroup {
lint: Lint {
label: "let_underscore",
description: r##"lint group for: let-underscore-drop, let-underscore-lock"##,
},
children: &["let_underscore_drop", "let_underscore_lock"],
},
LintGroup {
lint: Lint {
label: "nonstandard_style",
description: r##"lint group for: non-camel-case-types, non-snake-case, non-upper-case-globals"##,
},
children: &["non_camel_case_types", "non_snake_case", "non_upper_case_globals"],
},
LintGroup {
lint: Lint {
label: "refining_impl_trait",
description: r##"lint group for: refining-impl-trait-reachable, refining-impl-trait-internal"##,
},
children: &["refining_impl_trait_reachable", "refining_impl_trait_internal"],
},
LintGroup {
lint: Lint {
label: "rust_2018_compatibility",
description: r##"lint group for: keyword-idents-2018, anonymous-parameters, absolute-paths-not-starting-with-crate, tyvar-behind-raw-pointer"##,
},
children: &[
"keyword_idents_2018",
"anonymous_parameters",
"absolute_paths_not_starting_with_crate",
"tyvar_behind_raw_pointer",
],
},
LintGroup {
lint: Lint {
label: "rust_2018_idioms",
description: r##"lint group for: bare-trait-objects, unused-extern-crates, ellipsis-inclusive-range-patterns, elided-lifetimes-in-paths, explicit-outlives-requirements"##,
},
children: &[
"bare_trait_objects",
"unused_extern_crates",
"ellipsis_inclusive_range_patterns",
"elided_lifetimes_in_paths",
"explicit_outlives_requirements",
],
},
LintGroup {
lint: Lint {
label: "rust_2021_compatibility",
description: r##"lint group for: ellipsis-inclusive-range-patterns, bare-trait-objects, rust-2021-incompatible-closure-captures, rust-2021-incompatible-or-patterns, rust-2021-prefixes-incompatible-syntax, rust-2021-prelude-collisions, array-into-iter, non-fmt-panics"##,
},
children: &[
"ellipsis_inclusive_range_patterns",
"bare_trait_objects",
"rust_2021_incompatible_closure_captures",
"rust_2021_incompatible_or_patterns",
"rust_2021_prefixes_incompatible_syntax",
"rust_2021_prelude_collisions",
"array_into_iter",
"non_fmt_panics",
],
},
LintGroup {
lint: Lint {
label: "rust_2024_compatibility",
description: r##"lint group for: keyword-idents-2024, deprecated-safe, missing-unsafe-on-extern, static-mut-refs, unsafe-attr-outside-unsafe, unsafe-op-in-unsafe-fn, boxed-slice-into-iter"##,
},
children: &[
"keyword_idents_2024",
"deprecated_safe",
"missing_unsafe_on_extern",
"static_mut_refs",
"unsafe_attr_outside_unsafe",
"unsafe_op_in_unsafe_fn",
"boxed_slice_into_iter",
],
},
LintGroup {
lint: Lint {
label: "unused",
description: r##"lint group for: unused-imports, unused-variables, unused-assignments, dead-code, unused-mut, unreachable-code, unreachable-patterns, unused-must-use, unused-unsafe, path-statements, unused-attributes, unused-macros, unused-macro-rules, unused-allocation, unused-doc-comments, unused-extern-crates, unused-features, unused-labels, unused-parens, unused-braces, redundant-semicolons, map-unit-fn"##,
},
children: &[
"unused_imports",
"unused_variables",
"unused_assignments",
"dead_code",
"unused_mut",
"unreachable_code",
"unreachable_patterns",
"unused_must_use",
"unused_unsafe",
"path_statements",
"unused_attributes",
"unused_macros",
"unused_macro_rules",
"unused_allocation",
"unused_doc_comments",
"unused_extern_crates",
"unused_features",
"unused_labels",
"unused_parens",
"unused_braces",
"redundant_semicolons",
"map_unit_fn",
],
},
LintGroup {
lint: Lint {
label: "warnings",
description: r##"lint group for: all lints that are set to issue warnings"##,
},
children: &[],
},
];
pub const RUSTDOC_LINTS: &[Lint] = &[
Lint {
label: "rustdoc::all",
description: r##"lint group for: rustdoc::broken-intra-doc-links, rustdoc::private-intra-doc-links, rustdoc::private-doc-tests, rustdoc::invalid-codeblock-attributes, rustdoc::invalid-rust-codeblocks, rustdoc::invalid-html-tags, rustdoc::bare-urls, rustdoc::missing-crate-level-docs, rustdoc::unescaped-backticks, rustdoc::redundant-explicit-links, rustdoc::unportable-markdown"##,
},
Lint { label: "rustdoc::bare_urls", description: r##"detects URLs that are not hyperlinks"## },
Lint {
label: "rustdoc::broken_intra_doc_links",
description: r##"failures in resolving intra-doc link targets"##,
},
Lint {
label: "rustdoc::invalid_codeblock_attributes",
description: r##"codeblock attribute looks a lot like a known one"##,
},
Lint {
label: "rustdoc::invalid_html_tags",
description: r##"detects invalid HTML tags in doc comments"##,
},
Lint {
label: "rustdoc::invalid_rust_codeblocks",
description: r##"codeblock could not be parsed as valid Rust or is empty"##,
},
Lint {
label: "rustdoc::missing_crate_level_docs",
description: r##"detects crates with no crate-level documentation"##,
},
Lint {
label: "rustdoc::missing_doc_code_examples",
description: r##"detects publicly-exported items without code samples in their documentation"##,
},
Lint {
label: "rustdoc::private_doc_tests",
description: r##"detects code samples in docs of private items not documented by rustdoc"##,
},
Lint {
label: "rustdoc::private_intra_doc_links",
description: r##"linking from a public item to a private one"##,
},
Lint {
label: "rustdoc::redundant_explicit_links",
description: r##"detects redundant explicit links in doc comments"##,
},
Lint {
label: "rustdoc::unescaped_backticks",
description: r##"detects unescaped backticks in doc comments"##,
},
Lint {
label: "rustdoc::unportable_markdown",
description: r##"detects markdown that is interpreted differently in different parser"##,
},
];
pub const RUSTDOC_LINT_GROUPS: &[LintGroup] = &[LintGroup {
lint: Lint {
label: "rustdoc::all",
description: r##"lint group for: rustdoc::broken-intra-doc-links, rustdoc::private-intra-doc-links, rustdoc::private-doc-tests, rustdoc::invalid-codeblock-attributes, rustdoc::invalid-rust-codeblocks, rustdoc::invalid-html-tags, rustdoc::bare-urls, rustdoc::missing-crate-level-docs, rustdoc::unescaped-backticks, rustdoc::redundant-explicit-links, rustdoc::unportable-markdown"##,
},
children: &[
"rustdoc::broken_intra_doc_links",
"rustdoc::private_intra_doc_links",
"rustdoc::private_doc_tests",
"rustdoc::invalid_codeblock_attributes",
"rustdoc::invalid_rust_codeblocks",
"rustdoc::invalid_html_tags",
"rustdoc::bare_urls",
"rustdoc::missing_crate_level_docs",
"rustdoc::unescaped_backticks",
"rustdoc::redundant_explicit_links",
"rustdoc::unportable_markdown",
],
}];
pub const FEATURES: &[Lint] = &[
Lint {
label: "aarch64_ver_target_feature",
description: r##"# `aarch64_ver_target_feature`
The tracking issue for this feature is: [#44839]
[#44839]: https://github.com/rust-lang/rust/issues/44839
------------------------
"##,
},
Lint {
label: "abi_avr_interrupt",
description: r##"# `abi_avr_interrupt`
The tracking issue for this feature is: [#69664]
[#69664]: https://github.com/rust-lang/rust/issues/69664
------------------------
"##,
},
Lint {
label: "abi_c_cmse_nonsecure_call",
description: r##"# `abi_c_cmse_nonsecure_call`
The tracking issue for this feature is: [#81391]
[#81391]: https://github.com/rust-lang/rust/issues/81391
------------------------
The [TrustZone-M
feature](https://developer.arm.com/documentation/100690/latest/) is available
for targets with the Armv8-M architecture profile (`thumbv8m` in their target
name).
LLVM, the Rust compiler and the linker are providing
[support](https://developer.arm.com/documentation/ecm0359818/latest/) for the
TrustZone-M feature.
One of the things provided, with this unstable feature, is the
`C-cmse-nonsecure-call` function ABI. This ABI is used on function pointers to
non-secure code to mark a non-secure function call (see [section
5.5](https://developer.arm.com/documentation/ecm0359818/latest/) for details).
With this ABI, the compiler will do the following to perform the call:
* save registers needed after the call to Secure memory
* clear all registers that might contain confidential information
* clear the Least Significant Bit of the function address
* branches using the BLXNS instruction
To avoid using the non-secure stack, the compiler will constrain the number and
type of parameters/return value.
The `extern "C-cmse-nonsecure-call"` ABI is otherwise equivalent to the
`extern "C"` ABI.
<!-- NOTE(ignore) this example is specific to thumbv8m targets -->
``` rust,ignore
#![no_std]
#![feature(abi_c_cmse_nonsecure_call)]
#[no_mangle]
pub fn call_nonsecure_function(addr: usize) -> u32 {
let non_secure_function =
unsafe { core::mem::transmute::<usize, extern "C-cmse-nonsecure-call" fn() -> u32>(addr) };
non_secure_function()
}
```
``` text
$ rustc --emit asm --crate-type lib --target thumbv8m.main-none-eabi function.rs
call_nonsecure_function:
.fnstart
.save {r7, lr}
push {r7, lr}
.setfp r7, sp
mov r7, sp
.pad #16
sub sp, #16
str r0, [sp, #12]
ldr r0, [sp, #12]
str r0, [sp, #8]
b .LBB0_1
.LBB0_1:
ldr r0, [sp, #8]
push.w {r4, r5, r6, r7, r8, r9, r10, r11}
bic r0, r0, #1
mov r1, r0
mov r2, r0
mov r3, r0
mov r4, r0
mov r5, r0
mov r6, r0
mov r7, r0
mov r8, r0
mov r9, r0
mov r10, r0
mov r11, r0
mov r12, r0
msr apsr_nzcvq, r0
blxns r0
pop.w {r4, r5, r6, r7, r8, r9, r10, r11}
str r0, [sp, #4]
b .LBB0_2
.LBB0_2:
ldr r0, [sp, #4]
add sp, #16
pop {r7, pc}
```
"##,
},
Lint {
label: "abi_msp430_interrupt",
description: r##"# `abi_msp430_interrupt`
The tracking issue for this feature is: [#38487]
[#38487]: https://github.com/rust-lang/rust/issues/38487
------------------------
In the MSP430 architecture, interrupt handlers have a special calling
convention. You can use the `"msp430-interrupt"` ABI to make the compiler apply
the right calling convention to the interrupt handlers you define.
<!-- NOTE(ignore) this example is specific to the msp430 target -->
``` rust,ignore
#![feature(abi_msp430_interrupt)]
#![no_std]
// Place the interrupt handler at the appropriate memory address
// (Alternatively, you can use `#[used]` and remove `pub` and `#[no_mangle]`)
#[link_section = "__interrupt_vector_10"]
#[no_mangle]
pub static TIM0_VECTOR: extern "msp430-interrupt" fn() = tim0;
// The interrupt handler
extern "msp430-interrupt" fn tim0() {
// ..
}
```
``` text
$ msp430-elf-objdump -CD ./target/msp430/release/app
Disassembly of section __interrupt_vector_10:
0000fff2 <TIM0_VECTOR>:
fff2: 00 c0 interrupt service routine at 0xc000
Disassembly of section .text:
0000c000 <int::tim0>:
c000: 00 13 reti
```
"##,
},
Lint {
label: "abi_ptx",
description: r##"# `abi_ptx`
The tracking issue for this feature is: [#38788]
[#38788]: https://github.com/rust-lang/rust/issues/38788
------------------------
When emitting PTX code, all vanilla Rust functions (`fn`) get translated to
"device" functions. These functions are *not* callable from the host via the
CUDA API so a crate with only device functions is not too useful!
OTOH, "global" functions *can* be called by the host; you can think of them
as the real public API of your crate. To produce a global function use the
`"ptx-kernel"` ABI.
<!-- NOTE(ignore) this example is specific to the nvptx targets -->
``` rust,ignore
#![feature(abi_ptx)]
#![no_std]
pub unsafe extern "ptx-kernel" fn global_function() {
device_function();
}
pub fn device_function() {
// ..
}
```
``` text
$ xargo rustc --target nvptx64-nvidia-cuda --release -- --emit=asm
$ cat $(find -name '*.s')
//
// Generated by LLVM NVPTX Back-End
//
.version 3.2
.target sm_20
.address_size 64
// .globl _ZN6kernel15global_function17h46111ebe6516b382E
.visible .entry _ZN6kernel15global_function17h46111ebe6516b382E()
{
ret;
}
// .globl _ZN6kernel15device_function17hd6a0e4993bbf3f78E
.visible .func _ZN6kernel15device_function17hd6a0e4993bbf3f78E()
{
ret;
}
```
"##,
},
Lint {
label: "abi_riscv_interrupt",
description: r##"# `abi_riscv_interrupt`
The tracking issue for this feature is: [#111889]
[#111889]: https://github.com/rust-lang/rust/issues/111889
------------------------
"##,
},
Lint {
label: "abi_unadjusted",
description: r##"# `abi_unadjusted`
This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
------------------------
"##,
},
Lint {
label: "abi_vectorcall",
description: r##"# `abi_vectorcall`
The tracking issue for this feature is: [#124485]
[#124485]: https://github.com/rust-lang/rust/issues/124485
------------------------
Adds support for the Windows `"vectorcall"` ABI, the equivalent of `__vectorcall` in MSVC.
```rust,ignore (only-windows-or-x86-or-x86-64)
extern "vectorcall" {
fn add_f64s(x: f64, y: f64) -> f64;
}
fn main() {
println!("{}", add_f64s(2.0, 4.0));
}
```
"##,
},
Lint {
label: "abi_x86_interrupt",
description: r##"# `abi_x86_interrupt`
The tracking issue for this feature is: [#40180]
[#40180]: https://github.com/rust-lang/rust/issues/40180
------------------------
"##,
},
Lint {
label: "acceptfilter",
description: r##"# `acceptfilter`
The tracking issue for this feature is: [#121891]
[#121891]: https://github.com/rust-lang/rust/issues/121891
------------------------
"##,
},
Lint {
label: "addr_parse_ascii",
description: r##"# `addr_parse_ascii`
The tracking issue for this feature is: [#101035]
[#101035]: https://github.com/rust-lang/rust/issues/101035
------------------------
"##,
},
Lint {
label: "adt_const_params",
description: r##"# `adt_const_params`
The tracking issue for this feature is: [#95174]
[#95174]: https://github.com/rust-lang/rust/issues/95174
------------------------
Allows for using more complex types for const parameters, such as structs or enums.
```rust
#![feature(adt_const_params)]
#![allow(incomplete_features)]
use std::marker::ConstParamTy;
#[derive(ConstParamTy, PartialEq, Eq)]
enum Foo {
A,
B,
C,
}
#[derive(ConstParamTy, PartialEq, Eq)]
struct Bar {
flag: bool,
}
fn is_foo_a_and_bar_true<const F: Foo, const B: Bar>() -> bool {
match (F, B.flag) {
(Foo::A, true) => true,
_ => false,
}
}
```
"##,
},
Lint {
label: "alloc_error_handler",
description: r##"# `alloc_error_handler`
The tracking issue for this feature is: [#51540]
[#51540]: https://github.com/rust-lang/rust/issues/51540
------------------------
"##,
},
Lint {
label: "alloc_error_hook",
description: r##"# `alloc_error_hook`
The tracking issue for this feature is: [#51245]
[#51245]: https://github.com/rust-lang/rust/issues/51245
------------------------
"##,
},
Lint {
label: "alloc_internals",
description: r##"# `alloc_internals`
This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
------------------------
"##,
},
Lint {
label: "alloc_layout_extra",
description: r##"# `alloc_layout_extra`
The tracking issue for this feature is: [#55724]
[#55724]: https://github.com/rust-lang/rust/issues/55724
------------------------
"##,
},
Lint {
label: "allocator_api",
description: r##"# `allocator_api`
The tracking issue for this feature is [#32838]
[#32838]: https://github.com/rust-lang/rust/issues/32838
------------------------
Sometimes you want the memory for one collection to use a different
allocator than the memory for another collection. In this case,
replacing the global allocator is not a workable option. Instead,
you need to pass in an instance of an `AllocRef` to each collection
for which you want a custom allocator.
TBD
"##,
},
Lint {
label: "allocator_internals",
description: r##"# `allocator_internals`
This feature does not have a tracking issue, it is an unstable implementation
detail of the `global_allocator` feature not intended for use outside the
compiler.
------------------------
"##,
},
Lint {
label: "allow_internal_unsafe",
description: r##"# `allow_internal_unsafe`
This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
------------------------
"##,
},
Lint {
label: "allow_internal_unstable",
description: r##"# `allow_internal_unstable`
This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
------------------------
"##,
},
Lint {
label: "anonymous_lifetime_in_impl_trait",
description: r##"# `anonymous_lifetime_in_impl_trait`
This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
------------------------
"##,
},
Lint {
label: "arbitrary_self_types",
description: r##"# `arbitrary_self_types`
The tracking issue for this feature is: [#44874]
[#44874]: https://github.com/rust-lang/rust/issues/44874
------------------------
"##,
},
Lint {
label: "arm_target_feature",
description: r##"# `arm_target_feature`
The tracking issue for this feature is: [#44839]
[#44839]: https://github.com/rust-lang/rust/issues/44839
------------------------
"##,
},
Lint {
label: "array_chunks",
description: r##"# `array_chunks`
The tracking issue for this feature is: [#74985]
[#74985]: https://github.com/rust-lang/rust/issues/74985
------------------------
"##,
},
Lint {
label: "array_into_iter_constructors",
description: r##"# `array_into_iter_constructors`
The tracking issue for this feature is: [#91583]
[#91583]: https://github.com/rust-lang/rust/issues/91583
------------------------
"##,
},
Lint {
label: "array_ptr_get",
description: r##"# `array_ptr_get`
The tracking issue for this feature is: [#119834]
[#119834]: https://github.com/rust-lang/rust/issues/119834
------------------------
"##,
},
Lint {
label: "array_repeat",
description: r##"# `array_repeat`
The tracking issue for this feature is: [#126695]
[#126695]: https://github.com/rust-lang/rust/issues/126695
------------------------
"##,
},
Lint {
label: "array_try_from_fn",
description: r##"# `array_try_from_fn`
The tracking issue for this feature is: [#89379]
[#89379]: https://github.com/rust-lang/rust/issues/89379
------------------------
"##,
},
Lint {
label: "array_try_map",
description: r##"# `array_try_map`
The tracking issue for this feature is: [#79711]
[#79711]: https://github.com/rust-lang/rust/issues/79711
------------------------
"##,
},
Lint {
label: "array_windows",
description: r##"# `array_windows`
The tracking issue for this feature is: [#75027]
[#75027]: https://github.com/rust-lang/rust/issues/75027
------------------------
"##,
},
Lint {
label: "as_array_of_cells",
description: r##"# `as_array_of_cells`
The tracking issue for this feature is: [#88248]
[#88248]: https://github.com/rust-lang/rust/issues/88248
------------------------
"##,
},
Lint {
label: "ascii_char",
description: r##"# `ascii_char`
The tracking issue for this feature is: [#110998]
[#110998]: https://github.com/rust-lang/rust/issues/110998
------------------------
"##,
},
Lint {
label: "ascii_char_variants",
description: r##"# `ascii_char_variants`
The tracking issue for this feature is: [#110998]
[#110998]: https://github.com/rust-lang/rust/issues/110998
------------------------
"##,
},
Lint {
label: "asm_const",
description: r##"# `asm_const`
The tracking issue for this feature is: [#93332]
[#93332]: https://github.com/rust-lang/rust/issues/93332
------------------------
This feature adds a `const <expr>` operand type to `asm!` and `global_asm!`.
- `<expr>` must be an integer constant expression.
- The value of the expression is formatted as a string and substituted directly into the asm template string.
"##,
},
Lint {
label: "asm_experimental_arch",
description: r##"# `asm_experimental_arch`
The tracking issue for this feature is: [#93335]
[#93335]: https://github.com/rust-lang/rust/issues/93335
------------------------
This feature tracks `asm!` and `global_asm!` support for the following architectures:
- NVPTX
- PowerPC
- Hexagon
- MIPS32r2 and MIPS64r2
- wasm32
- BPF
- SPIR-V
- AVR
- MSP430
- M68k
- CSKY
- s390x
- Arm64EC
## Register classes
| Architecture | Register class | Registers | LLVM constraint code |
| ------------ | -------------- | ---------------------------------- | -------------------- |
| MIPS | `reg` | `$[2-25]` | `r` |
| MIPS | `freg` | `$f[0-31]` | `f` |
| NVPTX | `reg16` | None\* | `h` |
| NVPTX | `reg32` | None\* | `r` |
| NVPTX | `reg64` | None\* | `l` |
| Hexagon | `reg` | `r[0-28]` | `r` |
| PowerPC | `reg` | `r[0-31]` | `r` |
| PowerPC | `reg_nonzero` | `r[1-31]` | `b` |
| PowerPC | `freg` | `f[0-31]` | `f` |
| PowerPC | `cr` | `cr[0-7]`, `cr` | Only clobbers |
| PowerPC | `xer` | `xer` | Only clobbers |
| wasm32 | `local` | None\* | `r` |
| BPF | `reg` | `r[0-10]` | `r` |
| BPF | `wreg` | `w[0-10]` | `w` |
| AVR | `reg` | `r[2-25]`, `XH`, `XL`, `ZH`, `ZL` | `r` |
| AVR | `reg_upper` | `r[16-25]`, `XH`, `XL`, `ZH`, `ZL` | `d` |
| AVR | `reg_pair` | `r3r2` .. `r25r24`, `X`, `Z` | `r` |
| AVR | `reg_iw` | `r25r24`, `X`, `Z` | `w` |
| AVR | `reg_ptr` | `X`, `Z` | `e` |
| MSP430 | `reg` | `r[0-15]` | `r` |
| M68k | `reg` | `d[0-7]`, `a[0-7]` | `r` |
| M68k | `reg_data` | `d[0-7]` | `d` |
| M68k | `reg_addr` | `a[0-3]` | `a` |
| CSKY | `reg` | `r[0-31]` | `r` |
| CSKY | `freg` | `f[0-31]` | `f` |
| s390x | `reg` | `r[0-10]`, `r[12-14]` | `r` |
| s390x | `freg` | `f[0-15]` | `f` |
| Arm64EC | `reg` | `x[0-12]`, `x[15-22]`, `x[25-27]`, `x30` | `r` |
| Arm64EC | `vreg` | `v[0-15]` | `w` |
| Arm64EC | `vreg_low16` | `v[0-15]` | `x` |
> **Notes**:
> - NVPTX doesn't have a fixed register set, so named registers are not supported.
>
> - WebAssembly doesn't have registers, so named registers are not supported.
# Register class supported types
| Architecture | Register class | Target feature | Allowed types |
| ------------ | ------------------------------- | -------------- | --------------------------------------- |
| MIPS32 | `reg` | None | `i8`, `i16`, `i32`, `f32` |
| MIPS32 | `freg` | None | `f32`, `f64` |
| MIPS64 | `reg` | None | `i8`, `i16`, `i32`, `i64`, `f32`, `f64` |
| MIPS64 | `freg` | None | `f32`, `f64` |
| NVPTX | `reg16` | None | `i8`, `i16` |
| NVPTX | `reg32` | None | `i8`, `i16`, `i32`, `f32` |
| NVPTX | `reg64` | None | `i8`, `i16`, `i32`, `f32`, `i64`, `f64` |
| Hexagon | `reg` | None | `i8`, `i16`, `i32`, `f32` |
| PowerPC | `reg` | None | `i8`, `i16`, `i32` |
| PowerPC | `reg_nonzero` | None | `i8`, `i16`, `i32` |
| PowerPC | `freg` | None | `f32`, `f64` |
| PowerPC | `cr` | N/A | Only clobbers |
| PowerPC | `xer` | N/A | Only clobbers |
| wasm32 | `local` | None | `i8` `i16` `i32` `i64` `f32` `f64` |
| BPF | `reg` | None | `i8` `i16` `i32` `i64` |
| BPF | `wreg` | `alu32` | `i8` `i16` `i32` |
| AVR | `reg`, `reg_upper` | None | `i8` |
| AVR | `reg_pair`, `reg_iw`, `reg_ptr` | None | `i16` |
| MSP430 | `reg` | None | `i8`, `i16` |
| M68k | `reg`, `reg_addr` | None | `i16`, `i32` |
| M68k | `reg_data` | None | `i8`, `i16`, `i32` |
| CSKY | `reg` | None | `i8`, `i16`, `i32` |
| CSKY | `freg` | None | `f32`, |
| s390x | `reg`, `reg_addr` | None | `i8`, `i16`, `i32`, `i64` |
| s390x | `freg` | None | `f32`, `f64` |
| Arm64EC | `reg` | None | `i8`, `i16`, `i32`, `f32`, `i64`, `f64` |
| Arm64EC | `vreg` | None | `i8`, `i16`, `i32`, `f32`, `i64`, `f64`, <br> `i8x8`, `i16x4`, `i32x2`, `i64x1`, `f32x2`, `f64x1`, <br> `i8x16`, `i16x8`, `i32x4`, `i64x2`, `f32x4`, `f64x2` |
## Register aliases
| Architecture | Base register | Aliases |
| ------------ | ------------- | --------- |
| Hexagon | `r29` | `sp` |
| Hexagon | `r30` | `fr` |
| Hexagon | `r31` | `lr` |
| BPF | `r[0-10]` | `w[0-10]` |
| AVR | `XH` | `r27` |
| AVR | `XL` | `r26` |
| AVR | `ZH` | `r31` |
| AVR | `ZL` | `r30` |
| MSP430 | `r0` | `pc` |
| MSP430 | `r1` | `sp` |
| MSP430 | `r2` | `sr` |
| MSP430 | `r3` | `cg` |
| MSP430 | `r4` | `fp` |
| M68k | `a5` | `bp` |
| M68k | `a6` | `fp` |
| M68k | `a7` | `sp`, `usp`, `ssp`, `isp` |
| CSKY | `r[0-3]` | `a[0-3]` |
| CSKY | `r[4-11]` | `l[0-7]` |
| CSKY | `r[12-13]` | `t[0-1]` |
| CSKY | `r14` | `sp` |
| CSKY | `r15` | `lr` |
| CSKY | `r[16-17]` | `l[8-9]` |
| CSKY | `r[18-25]` | `t[2-9]` |
| CSKY | `r28` | `rgb` |
| CSKY | `r29` | `rtb` |
| CSKY | `r30` | `svbr` |
| CSKY | `r31` | `tls` |
| Arm64EC | `x[0-30]` | `w[0-30]` |
| Arm64EC | `x29` | `fp` |
| Arm64EC | `x30` | `lr` |
| Arm64EC | `sp` | `wsp` |
| Arm64EC | `xzr` | `wzr` |
| Arm64EC | `v[0-15]` | `b[0-15]`, `h[0-15]`, `s[0-15]`, `d[0-15]`, `q[0-15]` |
> **Notes**:
> - TI does not mandate a frame pointer for MSP430, but toolchains are allowed
to use one; LLVM uses `r4`.
## Unsupported registers
| Architecture | Unsupported register | Reason |
| ------------ | --------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| All | `sp`, `r15` (s390x) | The stack pointer must be restored to its original value at the end of an asm code block. |
| All | `fr` (Hexagon), `$fp` (MIPS), `Y` (AVR), `r4` (MSP430), `a6` (M68k), `r11` (s390x), `x29` (Arm64EC) | The frame pointer cannot be used as an input or output. |
| All | `r19` (Hexagon), `x19` (Arm64EC) | This is used internally by LLVM as a "base pointer" for functions with complex stack frames. |
| MIPS | `$0` or `$zero` | This is a constant zero register which can't be modified. |
| MIPS | `$1` or `$at` | Reserved for assembler. |
| MIPS | `$26`/`$k0`, `$27`/`$k1` | OS-reserved registers. |
| MIPS | `$28`/`$gp` | Global pointer cannot be used as inputs or outputs. |
| MIPS | `$ra` | Return address cannot be used as inputs or outputs. |
| Hexagon | `lr` | This is the link register which cannot be used as an input or output. |
| AVR | `r0`, `r1`, `r1r0` | Due to an issue in LLVM, the `r0` and `r1` registers cannot be used as inputs or outputs. If modified, they must be restored to their original values before the end of the block. |
|MSP430 | `r0`, `r2`, `r3` | These are the program counter, status register, and constant generator respectively. Neither the status register nor constant generator can be written to. |
| M68k | `a4`, `a5` | Used internally by LLVM for the base pointer and global base pointer. |
| CSKY | `r7`, `r28` | Used internally by LLVM for the base pointer and global base pointer. |
| CSKY | `r8` | Used internally by LLVM for the frame pointer. |
| CSKY | `r14` | Used internally by LLVM for the stack pointer. |
| CSKY | `r15` | This is the link register. |
| CSKY | `r[26-30]` | Reserved by its ABI. |
| CSKY | `r31` | This is the TLS register. |
| Arm64EC | `xzr` | This is a constant zero register which can't be modified. |
| Arm64EC | `x18` | This is an OS-reserved register. |
| Arm64EC | `x13`, `x14`, `x23`, `x24`, `x28`, `v[16-31]` | These are AArch64 registers that are not supported for Arm64EC. |
## Template modifiers
| Architecture | Register class | Modifier | Example output | LLVM modifier |
| ------------ | -------------- | -------- | -------------- | ------------- |
| MIPS | `reg` | None | `$2` | None |
| MIPS | `freg` | None | `$f0` | None |
| NVPTX | `reg16` | None | `rs0` | None |
| NVPTX | `reg32` | None | `r0` | None |
| NVPTX | `reg64` | None | `rd0` | None |
| Hexagon | `reg` | None | `r0` | None |
| PowerPC | `reg` | None | `0` | None |
| PowerPC | `reg_nonzero` | None | `3` | None |
| PowerPC | `freg` | None | `0` | None |
| s390x | `reg` | None | `%r0` | None |
| s390x | `reg_addr` | None | `%r1` | None |
| s390x | `freg` | None | `%f0` | None |
| CSKY | `reg` | None | `r0` | None |
| CSKY | `freg` | None | `f0` | None |
| Arm64EC | `reg` | None | `x0` | `x` |
| Arm64EC | `reg` | `w` | `w0` | `w` |
| Arm64EC | `reg` | `x` | `x0` | `x` |
| Arm64EC | `vreg` | None | `v0` | None |
| Arm64EC | `vreg` | `v` | `v0` | None |
| Arm64EC | `vreg` | `b` | `b0` | `b` |
| Arm64EC | `vreg` | `h` | `h0` | `h` |
| Arm64EC | `vreg` | `s` | `s0` | `s` |
| Arm64EC | `vreg` | `d` | `d0` | `d` |
| Arm64EC | `vreg` | `q` | `q0` | `q` |
# Flags covered by `preserves_flags`
These flags registers must be restored upon exiting the asm block if the `preserves_flags` option is set:
- AVR
- The status register `SREG`.
- MSP430
- The status register `r2`.
- M68k
- The condition code register `ccr`.
- s390x
- The condition code register `cc`.
- Arm64EC
- Condition flags (`NZCV` register).
- Floating-point status (`FPSR` register).
"##,
},
Lint {
label: "asm_goto",
description: r##"# `asm_goto`
The tracking issue for this feature is: [#119364]
[#119364]: https://github.com/rust-lang/rust/issues/119364
------------------------
This feature adds a `label <block>` operand type to `asm!`.
Example:
```rust,ignore (partial-example, x86-only)
unsafe {
asm!(
"jmp {}",
label {
println!("Jumped from asm!");
}
);
}
```
The block must have unit type or diverge.
When `label <block>` is used together with `noreturn` option, it means that the
assembly will not fallthrough. It's allowed to jump to a label within the
assembly. In this case, the entire `asm!` expression will have an unit type as
opposed to diverging, if not all label blocks diverge. The `asm!` expression
still diverges if `noreturn` option is used and all label blocks diverge.
"##,
},
Lint {
label: "asm_unwind",
description: r##"# `asm_unwind`
The tracking issue for this feature is: [#93334]
[#93334]: https://github.com/rust-lang/rust/issues/93334
------------------------
This feature adds a `may_unwind` option to `asm!` which allows an `asm` block to unwind stack and be part of the stack unwinding process. This option is only supported by the LLVM backend right now.
"##,
},
Lint {
label: "assert_matches",
description: r##"# `assert_matches`
The tracking issue for this feature is: [#82775]
[#82775]: https://github.com/rust-lang/rust/issues/82775
------------------------
"##,
},
Lint {
label: "associated_const_equality",
description: r##"# `associated_const_equality`
The tracking issue for this feature is: [#92827]
[#92827]: https://github.com/rust-lang/rust/issues/92827
------------------------
"##,
},
Lint {
label: "associated_type_defaults",
description: r##"# `associated_type_defaults`
The tracking issue for this feature is: [#29661]
[#29661]: https://github.com/rust-lang/rust/issues/29661
------------------------
"##,
},
Lint {
label: "async_closure",
description: r##"# `async_closure`
The tracking issue for this feature is: [#62290]
[#62290]: https://github.com/rust-lang/rust/issues/62290
------------------------
"##,
},
Lint {
label: "async_drop",
description: r##"# `async_drop`
The tracking issue for this feature is: [#126482]
[#126482]: https://github.com/rust-lang/rust/issues/126482
------------------------
"##,
},
Lint {
label: "async_fn_track_caller",
description: r##"# `async_fn_track_caller`
The tracking issue for this feature is: [#110011]
[#110011]: https://github.com/rust-lang/rust/issues/110011
------------------------
"##,
},
Lint {
label: "async_fn_traits",
description: r##"# `async_fn_traits`
See Also: [`fn_traits`](../library-features/fn-traits.md)
----
The `async_fn_traits` feature allows for implementation of the [`AsyncFn*`] traits
for creating custom closure-like types that return futures.
[`AsyncFn*`]: ../../std/ops/trait.AsyncFn.html
The main difference to the `Fn*` family of traits is that `AsyncFn` can return a future
that borrows from itself (`FnOnce::Output` has no lifetime parameters, while `AsyncFnMut::CallRefFuture` does).
"##,
},
Lint {
label: "async_for_loop",
description: r##"# `async_for_loop`
The tracking issue for this feature is: [#118898]
[#118898]: https://github.com/rust-lang/rust/issues/118898
------------------------
"##,
},
Lint {
label: "async_gen_internals",
description: r##"# `async_gen_internals`
This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
------------------------
"##,
},
Lint {
label: "async_iter_from_iter",
description: r##"# `async_iter_from_iter`
The tracking issue for this feature is: [#81798]
[#81798]: https://github.com/rust-lang/rust/issues/81798
------------------------
"##,
},
Lint {
label: "async_iterator",
description: r##"# `async_iterator`
The tracking issue for this feature is: [#79024]
[#79024]: https://github.com/rust-lang/rust/issues/79024
------------------------
"##,
},
Lint {
label: "atomic_from_mut",
description: r##"# `atomic_from_mut`
The tracking issue for this feature is: [#76314]
[#76314]: https://github.com/rust-lang/rust/issues/76314
------------------------
"##,
},
Lint {
label: "auto_traits",
description: r##"# `auto_traits`
The tracking issue for this feature is [#13231]
[#13231]: https://github.com/rust-lang/rust/issues/13231
----
The `auto_traits` feature gate allows you to define auto traits.
Auto traits, like [`Send`] or [`Sync`] in the standard library, are marker traits
that are automatically implemented for every type, unless the type, or a type it contains,
has explicitly opted out via a negative impl. (Negative impls are separately controlled
by the `negative_impls` feature.)
[`Send`]: ../../std/marker/trait.Send.html
[`Sync`]: ../../std/marker/trait.Sync.html
```rust,ignore (partial-example)
impl !Trait for Type {}
```
Example:
```rust
#![feature(negative_impls)]
#![feature(auto_traits)]
auto trait Valid {}
struct True;
struct False;
impl !Valid for False {}
struct MaybeValid<T>(T);
fn must_be_valid<T: Valid>(_t: T) { }
fn main() {
// works
must_be_valid( MaybeValid(True) );
// compiler error - trait bound not satisfied
// must_be_valid( MaybeValid(False) );
}
```
## Automatic trait implementations
When a type is declared as an `auto trait`, we will automatically
create impls for every struct/enum/union, unless an explicit impl is
provided. These automatic impls contain a where clause for each field
of the form `T: AutoTrait`, where `T` is the type of the field and
`AutoTrait` is the auto trait in question. As an example, consider the
struct `List` and the auto trait `Send`:
```rust
struct List<T> {
data: T,
next: Option<Box<List<T>>>,
}
```
Presuming that there is no explicit impl of `Send` for `List`, the
compiler will supply an automatic impl of the form:
```rust
struct List<T> {
data: T,
next: Option<Box<List<T>>>,
}
unsafe impl<T> Send for List<T>
where
T: Send, // from the field `data`
Option<Box<List<T>>>: Send, // from the field `next`
{ }
```
Explicit impls may be either positive or negative. They take the form:
```rust,ignore (partial-example)
impl<...> AutoTrait for StructName<..> { }
impl<...> !AutoTrait for StructName<..> { }
```
## Coinduction: Auto traits permit cyclic matching
Unlike ordinary trait matching, auto traits are **coinductive**. This
means, in short, that cycles which occur in trait matching are
considered ok. As an example, consider the recursive struct `List`
introduced in the previous section. In attempting to determine whether
`List: Send`, we would wind up in a cycle: to apply the impl, we must
show that `Option<Box<List>>: Send`, which will in turn require
`Box<List>: Send` and then finally `List: Send` again. Under ordinary
trait matching, this cycle would be an error, but for an auto trait it
is considered a successful match.
## Items
Auto traits cannot have any trait items, such as methods or associated types. This ensures that we can generate default implementations.
## Supertraits
Auto traits cannot have supertraits. This is for soundness reasons, as the interaction of coinduction with implied bounds is difficult to reconcile.
"##,
},
Lint {
label: "avx512_target_feature",
description: r##"# `avx512_target_feature`
The tracking issue for this feature is: [#44839]
[#44839]: https://github.com/rust-lang/rust/issues/44839
------------------------
"##,
},
Lint {
label: "backtrace_frames",
description: r##"# `backtrace_frames`
The tracking issue for this feature is: [#79676]
[#79676]: https://github.com/rust-lang/rust/issues/79676
------------------------
"##,
},
Lint {
label: "bigint_helper_methods",
description: r##"# `bigint_helper_methods`
The tracking issue for this feature is: [#85532]
[#85532]: https://github.com/rust-lang/rust/issues/85532
------------------------
"##,
},
Lint {
label: "binary_heap_drain_sorted",
description: r##"# `binary_heap_drain_sorted`
The tracking issue for this feature is: [#59278]
[#59278]: https://github.com/rust-lang/rust/issues/59278
------------------------
"##,
},
Lint {
label: "binary_heap_into_iter_sorted",
description: r##"# `binary_heap_into_iter_sorted`
The tracking issue for this feature is: [#59278]
[#59278]: https://github.com/rust-lang/rust/issues/59278
------------------------
"##,
},
Lint {
label: "bound_as_ref",
description: r##"# `bound_as_ref`
The tracking issue for this feature is: [#80996]
[#80996]: https://github.com/rust-lang/rust/issues/80996
------------------------
"##,
},
Lint {
label: "box_into_boxed_slice",
description: r##"# `box_into_boxed_slice`
The tracking issue for this feature is: [#71582]
[#71582]: https://github.com/rust-lang/rust/issues/71582
------------------------
"##,
},
Lint {
label: "box_into_inner",
description: r##"# `box_into_inner`
The tracking issue for this feature is: [#80437]
[#80437]: https://github.com/rust-lang/rust/issues/80437
------------------------
"##,
},
Lint {
label: "box_patterns",
description: r##"# `box_patterns`
The tracking issue for this feature is: [#29641]
[#29641]: https://github.com/rust-lang/rust/issues/29641
------------------------
Box patterns let you match on `Box<T>`s:
```rust
#![feature(box_patterns)]
fn main() {
let b = Some(Box::new(5));
match b {
Some(box n) if n < 0 => {
println!("Box contains negative number {n}");
},
Some(box n) if n >= 0 => {
println!("Box contains non-negative number {n}");
},
None => {
println!("No box");
},
_ => unreachable!()
}
}
```
"##,
},
Lint {
label: "bpf_target_feature",
description: r##"# `bpf_target_feature`
The tracking issue for this feature is: [#44839]
[#44839]: https://github.com/rust-lang/rust/issues/44839
------------------------
"##,
},
Lint {
label: "btree_cursors",
description: r##"# `btree_cursors`
The tracking issue for this feature is: [#107540]
[#107540]: https://github.com/rust-lang/rust/issues/107540
------------------------
"##,
},
Lint {
label: "btree_extract_if",
description: r##"# `btree_extract_if`
The tracking issue for this feature is: [#70530]
[#70530]: https://github.com/rust-lang/rust/issues/70530
------------------------
"##,
},
Lint {
label: "btreemap_alloc",
description: r##"# `btreemap_alloc`
The tracking issue for this feature is: [#32838]
[#32838]: https://github.com/rust-lang/rust/issues/32838
------------------------
"##,
},
Lint {
label: "buf_read_has_data_left",
description: r##"# `buf_read_has_data_left`
The tracking issue for this feature is: [#86423]
[#86423]: https://github.com/rust-lang/rust/issues/86423
------------------------
"##,
},
Lint {
label: "bufread_skip_until",
description: r##"# `bufread_skip_until`
The tracking issue for this feature is: [#111735]
[#111735]: https://github.com/rust-lang/rust/issues/111735
------------------------
"##,
},
Lint {
label: "build_hasher_default_const_new",
description: r##"# `build_hasher_default_const_new`
The tracking issue for this feature is: [#123197]
[#123197]: https://github.com/rust-lang/rust/issues/123197
------------------------
"##,
},
Lint {
label: "builtin_syntax",
description: r##"# `builtin_syntax`
The tracking issue for this feature is: [#110680]
[#110680]: https://github.com/rust-lang/rust/issues/110680
------------------------
"##,
},
Lint {
label: "c_size_t",
description: r##"# `c_size_t`
The tracking issue for this feature is: [#88345]
[#88345]: https://github.com/rust-lang/rust/issues/88345
------------------------
"##,
},
Lint {
label: "c_str_module",
description: r##"# `c_str_module`
The tracking issue for this feature is: [#112134]
[#112134]: https://github.com/rust-lang/rust/issues/112134
------------------------
"##,
},
Lint {
label: "c_variadic",
description: r##"# `c_variadic`
The tracking issue for this feature is: [#44930]
[#44930]: https://github.com/rust-lang/rust/issues/44930
------------------------
The `c_variadic` language feature enables C-variadic functions to be
defined in Rust. They may be called both from within Rust and via FFI.
## Examples
```rust
#![feature(c_variadic)]
pub unsafe extern "C" fn add(n: usize, mut args: ...) -> usize {
let mut sum = 0;
for _ in 0..n {
sum += args.arg::<usize>();
}
sum
}
```
"##,
},
Lint {
label: "c_variadic",
description: r##"# `c_variadic`
The tracking issue for this feature is: [#44930]
[#44930]: https://github.com/rust-lang/rust/issues/44930
------------------------
The `c_variadic` library feature exposes the `VaList` structure,
Rust's analogue of C's `va_list` type.
## Examples
```rust
#![feature(c_variadic)]
use std::ffi::VaList;
pub unsafe extern "C" fn vadd(n: usize, mut args: VaList) -> usize {
let mut sum = 0;
for _ in 0..n {
sum += args.arg::<usize>();
}
sum
}
```
"##,
},
Lint {
label: "c_void_variant",
description: r##"# `c_void_variant`
This feature is internal to the Rust compiler and is not intended for general use.
------------------------
"##,
},
Lint {
label: "can_vector",
description: r##"# `can_vector`
The tracking issue for this feature is: [#69941]
[#69941]: https://github.com/rust-lang/rust/issues/69941
------------------------
"##,
},
Lint {
label: "cell_leak",
description: r##"# `cell_leak`
The tracking issue for this feature is: [#69099]
[#69099]: https://github.com/rust-lang/rust/issues/69099
------------------------
"##,
},
Lint {
label: "cell_update",
description: r##"# `cell_update`
The tracking issue for this feature is: [#50186]
[#50186]: https://github.com/rust-lang/rust/issues/50186
------------------------
"##,
},
Lint {
label: "cfg_accessible",
description: r##"# `cfg_accessible`
The tracking issue for this feature is: [#64797]
[#64797]: https://github.com/rust-lang/rust/issues/64797
------------------------
"##,
},
Lint {
label: "cfg_eval",
description: r##"# `cfg_eval`
The tracking issue for this feature is: [#82679]
[#82679]: https://github.com/rust-lang/rust/issues/82679
------------------------
"##,
},
Lint {
label: "cfg_match",
description: r##"# `cfg_match`
The tracking issue for this feature is: [#115585]
[#115585]: https://github.com/rust-lang/rust/issues/115585
------------------------
"##,
},
Lint {
label: "cfg_overflow_checks",
description: r##"# `cfg_overflow_checks`
The tracking issue for this feature is: [#111466]
[#111466]: https://github.com/rust-lang/rust/issues/111466
------------------------
"##,
},
Lint {
label: "cfg_relocation_model",
description: r##"# `cfg_relocation_model`
The tracking issue for this feature is: [#114929]
[#114929]: https://github.com/rust-lang/rust/issues/114929
------------------------
"##,
},
Lint {
label: "cfg_sanitize",
description: r##"# `cfg_sanitize`
The tracking issue for this feature is: [#39699]
[#39699]: https://github.com/rust-lang/rust/issues/39699
------------------------
The `cfg_sanitize` feature makes it possible to execute different code
depending on whether a particular sanitizer is enabled or not.
## Examples
```rust
#![feature(cfg_sanitize)]
#[cfg(sanitize = "thread")]
fn a() {
// ...
}
#[cfg(not(sanitize = "thread"))]
fn a() {
// ...
}
fn b() {
if cfg!(sanitize = "leak") {
// ...
} else {
// ...
}
}
```
"##,
},
Lint {
label: "cfg_sanitizer_cfi",
description: r##"# `cfg_sanitizer_cfi`
The tracking issue for this feature is: [#89653]
[#89653]: https://github.com/rust-lang/rust/issues/89653
------------------------
"##,
},
Lint {
label: "cfg_target_compact",
description: r##"# `cfg_target_compact`
The tracking issue for this feature is: [#96901]
[#96901]: https://github.com/rust-lang/rust/issues/96901
------------------------
"##,
},
Lint {
label: "cfg_target_has_atomic",
description: r##"# `cfg_target_has_atomic`
The tracking issue for this feature is: [#94039]
[#94039]: https://github.com/rust-lang/rust/issues/94039
------------------------
"##,
},
Lint {
label: "cfg_target_has_atomic_equal_alignment",
description: r##"# `cfg_target_has_atomic_equal_alignment`
The tracking issue for this feature is: [#93822]
[#93822]: https://github.com/rust-lang/rust/issues/93822
------------------------
"##,
},
Lint {
label: "cfg_target_thread_local",
description: r##"# `cfg_target_thread_local`
The tracking issue for this feature is: [#29594]
[#29594]: https://github.com/rust-lang/rust/issues/29594
------------------------
"##,
},
Lint {
label: "cfg_ub_checks",
description: r##"# `cfg_ub_checks`
The tracking issue for this feature is: [#123499]
[#123499]: https://github.com/rust-lang/rust/issues/123499
------------------------
"##,
},
Lint {
label: "cfg_version",
description: r##"# `cfg_version`
The tracking issue for this feature is: [#64796]
[#64796]: https://github.com/rust-lang/rust/issues/64796
------------------------
The `cfg_version` feature makes it possible to execute different code
depending on the compiler version. It will return true if the compiler
version is greater than or equal to the specified version.
## Examples
```rust
#![feature(cfg_version)]
#[cfg(version("1.42"))] // 1.42 and above
fn a() {
// ...
}
#[cfg(not(version("1.42")))] // 1.41 and below
fn a() {
// ...
}
fn b() {
if cfg!(version("1.42")) {
// ...
} else {
// ...
}
}
```
"##,
},
Lint {
label: "cfi_encoding",
description: r##"# `cfi_encoding`
The tracking issue for this feature is: [#89653]
[#89653]: https://github.com/rust-lang/rust/issues/89653
------------------------
The `cfi_encoding` feature allows the user to define a CFI encoding for a type.
It allows the user to use a different names for types that otherwise would be
required to have the same name as used in externally defined C functions.
## Examples
```rust
#![feature(cfi_encoding, extern_types)]
#[cfi_encoding = "3Foo"]
pub struct Type1(i32);
extern {
#[cfi_encoding = "3Bar"]
type Type2;
}
```
"##,
},
Lint {
label: "char_indices_offset",
description: r##"# `char_indices_offset`
The tracking issue for this feature is: [#83871]
[#83871]: https://github.com/rust-lang/rust/issues/83871
------------------------
"##,
},
Lint {
label: "char_internals",
description: r##"# `char_internals`
This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
------------------------
"##,
},
Lint {
label: "char_min",
description: r##"# `char_min`
The tracking issue for this feature is: [#114298]
[#114298]: https://github.com/rust-lang/rust/issues/114298
------------------------
"##,
},
Lint {
label: "clone_to_uninit",
description: r##"# `clone_to_uninit`
The tracking issue for this feature is: [#126799]
[#126799]: https://github.com/rust-lang/rust/issues/126799
------------------------
"##,
},
Lint {
label: "closure_lifetime_binder",
description: r##"# `closure_lifetime_binder`
The tracking issue for this feature is: [#97362]
[#97362]: https://github.com/rust-lang/rust/issues/97362
------------------------
"##,
},
Lint {
label: "closure_track_caller",
description: r##"# `closure_track_caller`
The tracking issue for this feature is: [#87417]
[#87417]: https://github.com/rust-lang/rust/issues/87417
------------------------
Allows using the `#[track_caller]` attribute on closures and coroutines.
Calls made to the closure or coroutine will have caller information
available through `std::panic::Location::caller()`, just like using
`#[track_caller]` on a function.
"##,
},
Lint {
label: "cmp_minmax",
description: r##"# `cmp_minmax`
The tracking issue for this feature is: [#115939]
[#115939]: https://github.com/rust-lang/rust/issues/115939
------------------------
"##,
},
Lint {
label: "cmse_nonsecure_entry",
description: r##"# `cmse_nonsecure_entry`
The tracking issue for this feature is: [#75835]
[#75835]: https://github.com/rust-lang/rust/issues/75835
------------------------
The [TrustZone-M
feature](https://developer.arm.com/documentation/100690/latest/) is available
for targets with the Armv8-M architecture profile (`thumbv8m` in their target
name).
LLVM, the Rust compiler and the linker are providing
[support](https://developer.arm.com/documentation/ecm0359818/latest/) for the
TrustZone-M feature.
One of the things provided, with this unstable feature, is the
`cmse_nonsecure_entry` attribute. This attribute marks a Secure function as an
entry function (see [section
5.4](https://developer.arm.com/documentation/ecm0359818/latest/) for details).
With this attribute, the compiler will do the following:
* add a special symbol on the function which is the `__acle_se_` prefix and the
standard function name
* constrain the number of parameters to avoid using the Non-Secure stack
* before returning from the function, clear registers that might contain Secure
information
* use the `BXNS` instruction to return
Because the stack can not be used to pass parameters, there will be compilation
errors if:
* the total size of all parameters is too big (for example more than four 32
bits integers)
* the entry function is not using a C ABI
The special symbol `__acle_se_` will be used by the linker to generate a secure
gateway veneer.
<!-- NOTE(ignore) this example is specific to thumbv8m targets -->
``` rust,ignore
#![feature(cmse_nonsecure_entry)]
#[no_mangle]
#[cmse_nonsecure_entry]
pub extern "C" fn entry_function(input: u32) -> u32 {
input + 6
}
```
``` text
$ rustc --emit obj --crate-type lib --target thumbv8m.main-none-eabi function.rs
$ arm-none-eabi-objdump -D function.o
00000000 <entry_function>:
0: b580 push {r7, lr}
2: 466f mov r7, sp
4: b082 sub sp, #8
6: 9001 str r0, [sp, #4]
8: 1d81 adds r1, r0, #6
a: 460a mov r2, r1
c: 4281 cmp r1, r0
e: 9200 str r2, [sp, #0]
10: d30b bcc.n 2a <entry_function+0x2a>
12: e7ff b.n 14 <entry_function+0x14>
14: 9800 ldr r0, [sp, #0]
16: b002 add sp, #8
18: e8bd 4080 ldmia.w sp!, {r7, lr}
1c: 4671 mov r1, lr
1e: 4672 mov r2, lr
20: 4673 mov r3, lr
22: 46f4 mov ip, lr
24: f38e 8800 msr CPSR_f, lr
28: 4774 bxns lr
2a: f240 0000 movw r0, #0
2e: f2c0 0000 movt r0, #0
32: f240 0200 movw r2, #0
36: f2c0 0200 movt r2, #0
3a: 211c movs r1, #28
3c: f7ff fffe bl 0 <_ZN4core9panicking5panic17h5c028258ca2fb3f5E>
40: defe udf #254 ; 0xfe
```
"##,
},
Lint {
label: "coerce_unsized",
description: r##"# `coerce_unsized`
The tracking issue for this feature is: [#18598]
[#18598]: https://github.com/rust-lang/rust/issues/18598
------------------------
"##,
},
Lint {
label: "compiler_builtins",
description: r##"# `compiler_builtins`
This feature is internal to the Rust compiler and is not intended for general use.
------------------------
"##,
},
Lint {
label: "concat_bytes",
description: r##"# `concat_bytes`
The tracking issue for this feature is: [#87555]
[#87555]: https://github.com/rust-lang/rust/issues/87555
------------------------
"##,
},
Lint {
label: "concat_idents",
description: r##"# `concat_idents`
The tracking issue for this feature is: [#29599]
[#29599]: https://github.com/rust-lang/rust/issues/29599
------------------------
The `concat_idents` feature adds a macro for concatenating multiple identifiers
into one identifier.
## Examples
```rust
#![feature(concat_idents)]
fn main() {
fn foobar() -> u32 { 23 }
let f = concat_idents!(foo, bar);
assert_eq!(f(), 23);
}
```
"##,
},
Lint {
label: "const_align_of_val",
description: r##"# `const_align_of_val`
The tracking issue for this feature is: [#46571]
[#46571]: https://github.com/rust-lang/rust/issues/46571
------------------------
"##,
},
Lint {
label: "const_align_of_val_raw",
description: r##"# `const_align_of_val_raw`
The tracking issue for this feature is: [#46571]
[#46571]: https://github.com/rust-lang/rust/issues/46571
------------------------
"##,
},
Lint {
label: "const_align_offset",
description: r##"# `const_align_offset`
The tracking issue for this feature is: [#90962]
[#90962]: https://github.com/rust-lang/rust/issues/90962
------------------------
"##,
},
Lint {
label: "const_alloc_error",
description: r##"# `const_alloc_error`
The tracking issue for this feature is: [#92523]
[#92523]: https://github.com/rust-lang/rust/issues/92523
------------------------
"##,
},
Lint {
label: "const_alloc_layout",
description: r##"# `const_alloc_layout`
The tracking issue for this feature is: [#67521]
[#67521]: https://github.com/rust-lang/rust/issues/67521
------------------------
"##,
},
Lint {
label: "const_arguments_as_str",
description: r##"# `const_arguments_as_str`
The tracking issue for this feature is: [#103900]
[#103900]: https://github.com/rust-lang/rust/issues/103900
------------------------
"##,
},
Lint {
label: "const_array_from_ref",
description: r##"# `const_array_from_ref`
The tracking issue for this feature is: [#90206]
[#90206]: https://github.com/rust-lang/rust/issues/90206
------------------------
"##,
},
Lint {
label: "const_array_into_iter_constructors",
description: r##"# `const_array_into_iter_constructors`
The tracking issue for this feature is: [#91583]
[#91583]: https://github.com/rust-lang/rust/issues/91583
------------------------
"##,
},
Lint {
label: "const_async_blocks",
description: r##"# `const_async_blocks`
The tracking issue for this feature is: [#85368]
[#85368]: https://github.com/rust-lang/rust/issues/85368
------------------------
"##,
},
Lint {
label: "const_atomic_from_ptr",
description: r##"# `const_atomic_from_ptr`
The tracking issue for this feature is: [#108652]
[#108652]: https://github.com/rust-lang/rust/issues/108652
------------------------
"##,
},
Lint {
label: "const_bigint_helper_methods",
description: r##"# `const_bigint_helper_methods`
The tracking issue for this feature is: [#85532]
[#85532]: https://github.com/rust-lang/rust/issues/85532
------------------------
"##,
},
Lint {
label: "const_binary_heap_new_in",
description: r##"# `const_binary_heap_new_in`
The tracking issue for this feature is: [#112353]
[#112353]: https://github.com/rust-lang/rust/issues/112353
------------------------
"##,
},
Lint {
label: "const_black_box",
description: r##"# `const_black_box`
This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
------------------------
"##,
},
Lint {
label: "const_box",
description: r##"# `const_box`
The tracking issue for this feature is: [#92521]
[#92521]: https://github.com/rust-lang/rust/issues/92521
------------------------
"##,
},
Lint {
label: "const_btree_len",
description: r##"# `const_btree_len`
This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
------------------------
"##,
},
Lint {
label: "const_cell_into_inner",
description: r##"# `const_cell_into_inner`
The tracking issue for this feature is: [#78729]
[#78729]: https://github.com/rust-lang/rust/issues/78729
------------------------
"##,
},
Lint {
label: "const_closures",
description: r##"# `const_closures`
The tracking issue for this feature is: [#106003]
[#106003]: https://github.com/rust-lang/rust/issues/106003
------------------------
"##,
},
Lint {
label: "const_collections_with_hasher",
description: r##"# `const_collections_with_hasher`
The tracking issue for this feature is: [#102575]
[#102575]: https://github.com/rust-lang/rust/issues/102575
------------------------
"##,
},
Lint {
label: "const_cow_is_borrowed",
description: r##"# `const_cow_is_borrowed`
The tracking issue for this feature is: [#65143]
[#65143]: https://github.com/rust-lang/rust/issues/65143
------------------------
"##,
},
Lint {
label: "const_eval_select",
description: r##"# `const_eval_select`
The tracking issue for this feature is: [#124625]
[#124625]: https://github.com/rust-lang/rust/issues/124625
------------------------
"##,
},
Lint {
label: "const_exact_div",
description: r##"# `const_exact_div`
This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
------------------------
"##,
},
Lint {
label: "const_extern_fn",
description: r##"# `const_extern_fn`
The tracking issue for this feature is: [#64926]
[#64926]: https://github.com/rust-lang/rust/issues/64926
------------------------
"##,
},
Lint {
label: "const_float_bits_conv",
description: r##"# `const_float_bits_conv`
The tracking issue for this feature is: [#72447]
[#72447]: https://github.com/rust-lang/rust/issues/72447
------------------------
"##,
},
Lint {
label: "const_float_classify",
description: r##"# `const_float_classify`
The tracking issue for this feature is: [#72505]
[#72505]: https://github.com/rust-lang/rust/issues/72505
------------------------
"##,
},
Lint {
label: "const_fmt_arguments_new",
description: r##"# `const_fmt_arguments_new`
This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
------------------------
"##,
},
Lint {
label: "const_fn_floating_point_arithmetic",
description: r##"# `const_fn_floating_point_arithmetic`
The tracking issue for this feature is: [#57241]
[#57241]: https://github.com/rust-lang/rust/issues/57241
------------------------
"##,
},
Lint {
label: "const_for",
description: r##"# `const_for`
The tracking issue for this feature is: [#87575]
[#87575]: https://github.com/rust-lang/rust/issues/87575
------------------------
"##,
},
Lint {
label: "const_format_args",
description: r##"# `const_format_args`
This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
------------------------
"##,
},
Lint {
label: "const_hash",
description: r##"# `const_hash`
The tracking issue for this feature is: [#104061]
[#104061]: https://github.com/rust-lang/rust/issues/104061
------------------------
"##,
},
Lint {
label: "const_heap",
description: r##"# `const_heap`
The tracking issue for this feature is: [#79597]
[#79597]: https://github.com/rust-lang/rust/issues/79597
------------------------
"##,
},
Lint {
label: "const_index_range_slice_index",
description: r##"# `const_index_range_slice_index`
This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
------------------------
"##,
},
Lint {
label: "const_int_from_str",
description: r##"# `const_int_from_str`
The tracking issue for this feature is: [#59133]
[#59133]: https://github.com/rust-lang/rust/issues/59133
------------------------
"##,
},
Lint {
label: "const_intoiterator_identity",
description: r##"# `const_intoiterator_identity`
The tracking issue for this feature is: [#90603]
[#90603]: https://github.com/rust-lang/rust/issues/90603
------------------------
"##,
},
Lint {
label: "const_intrinsic_compare_bytes",
description: r##"# `const_intrinsic_compare_bytes`
This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
------------------------
"##,
},
Lint {
label: "const_intrinsic_copy",
description: r##"# `const_intrinsic_copy`
The tracking issue for this feature is: [#80697]
[#80697]: https://github.com/rust-lang/rust/issues/80697
------------------------
"##,
},
Lint {
label: "const_intrinsic_forget",
description: r##"# `const_intrinsic_forget`
This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
------------------------
"##,
},
Lint {
label: "const_intrinsic_raw_eq",
description: r##"# `const_intrinsic_raw_eq`
This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
------------------------
"##,
},
Lint {
label: "const_ip",
description: r##"# `const_ip`
The tracking issue for this feature is: [#76205]
[#76205]: https://github.com/rust-lang/rust/issues/76205
------------------------
"##,
},
Lint {
label: "const_ipv4",
description: r##"# `const_ipv4`
The tracking issue for this feature is: [#76205]
[#76205]: https://github.com/rust-lang/rust/issues/76205
------------------------
"##,
},
Lint {
label: "const_ipv6",
description: r##"# `const_ipv6`
The tracking issue for this feature is: [#76205]
[#76205]: https://github.com/rust-lang/rust/issues/76205
------------------------
"##,
},
Lint {
label: "const_likely",
description: r##"# `const_likely`
This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
------------------------
"##,
},
Lint {
label: "const_maybe_uninit_array_assume_init",
description: r##"# `const_maybe_uninit_array_assume_init`
The tracking issue for this feature is: [#96097]
[#96097]: https://github.com/rust-lang/rust/issues/96097
------------------------
"##,
},
Lint {
label: "const_maybe_uninit_as_mut_ptr",
description: r##"# `const_maybe_uninit_as_mut_ptr`
The tracking issue for this feature is: [#75251]
[#75251]: https://github.com/rust-lang/rust/issues/75251
------------------------
"##,
},
Lint {
label: "const_maybe_uninit_assume_init",
description: r##"# `const_maybe_uninit_assume_init`
This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
------------------------
"##,
},
Lint {
label: "const_maybe_uninit_uninit_array",
description: r##"# `const_maybe_uninit_uninit_array`
The tracking issue for this feature is: [#96097]
[#96097]: https://github.com/rust-lang/rust/issues/96097
------------------------
"##,
},
Lint {
label: "const_maybe_uninit_write",
description: r##"# `const_maybe_uninit_write`
The tracking issue for this feature is: [#63567]
[#63567]: https://github.com/rust-lang/rust/issues/63567
------------------------
"##,
},
Lint {
label: "const_mut_refs",
description: r##"# `const_mut_refs`
The tracking issue for this feature is: [#57349]
[#57349]: https://github.com/rust-lang/rust/issues/57349
------------------------
"##,
},
Lint {
label: "const_nonnull_new",
description: r##"# `const_nonnull_new`
The tracking issue for this feature is: [#93235]
[#93235]: https://github.com/rust-lang/rust/issues/93235
------------------------
"##,
},
Lint {
label: "const_num_midpoint",
description: r##"# `const_num_midpoint`
The tracking issue for this feature is: [#110840]
[#110840]: https://github.com/rust-lang/rust/issues/110840
------------------------
"##,
},
Lint {
label: "const_option",
description: r##"# `const_option`
The tracking issue for this feature is: [#67441]
[#67441]: https://github.com/rust-lang/rust/issues/67441
------------------------
"##,
},
Lint {
label: "const_option_ext",
description: r##"# `const_option_ext`
The tracking issue for this feature is: [#91930]
[#91930]: https://github.com/rust-lang/rust/issues/91930
------------------------
"##,
},
Lint {
label: "const_pin",
description: r##"# `const_pin`
The tracking issue for this feature is: [#76654]
[#76654]: https://github.com/rust-lang/rust/issues/76654
------------------------
"##,
},
Lint {
label: "const_pointer_is_aligned",
description: r##"# `const_pointer_is_aligned`
The tracking issue for this feature is: [#104203]
[#104203]: https://github.com/rust-lang/rust/issues/104203
------------------------
"##,
},
Lint {
label: "const_precise_live_drops",
description: r##"# `const_precise_live_drops`
The tracking issue for this feature is: [#73255]
[#73255]: https://github.com/rust-lang/rust/issues/73255
------------------------
"##,
},
Lint {
label: "const_pref_align_of",
description: r##"# `const_pref_align_of`
The tracking issue for this feature is: [#91971]
[#91971]: https://github.com/rust-lang/rust/issues/91971
------------------------
"##,
},
Lint {
label: "const_ptr_as_ref",
description: r##"# `const_ptr_as_ref`
The tracking issue for this feature is: [#91822]
[#91822]: https://github.com/rust-lang/rust/issues/91822
------------------------
"##,
},
Lint {
label: "const_ptr_is_null",
description: r##"# `const_ptr_is_null`
The tracking issue for this feature is: [#74939]
[#74939]: https://github.com/rust-lang/rust/issues/74939
------------------------
"##,
},
Lint {
label: "const_ptr_sub_ptr",
description: r##"# `const_ptr_sub_ptr`
The tracking issue for this feature is: [#95892]
[#95892]: https://github.com/rust-lang/rust/issues/95892
------------------------
"##,
},
Lint {
label: "const_ptr_write",
description: r##"# `const_ptr_write`
The tracking issue for this feature is: [#86302]
[#86302]: https://github.com/rust-lang/rust/issues/86302
------------------------
"##,
},
Lint {
label: "const_range_bounds",
description: r##"# `const_range_bounds`
The tracking issue for this feature is: [#108082]
[#108082]: https://github.com/rust-lang/rust/issues/108082
------------------------
"##,
},
Lint {
label: "const_raw_ptr_comparison",
description: r##"# `const_raw_ptr_comparison`
The tracking issue for this feature is: [#53020]
[#53020]: https://github.com/rust-lang/rust/issues/53020
------------------------
"##,
},
Lint {
label: "const_refs_to_cell",
description: r##"# `const_refs_to_cell`
The tracking issue for this feature is: [#80384]
[#80384]: https://github.com/rust-lang/rust/issues/80384
------------------------
"##,
},
Lint {
label: "const_refs_to_static",
description: r##"# `const_refs_to_static`
The tracking issue for this feature is: [#119618]
[#119618]: https://github.com/rust-lang/rust/issues/119618
------------------------
"##,
},
Lint {
label: "const_replace",
description: r##"# `const_replace`
The tracking issue for this feature is: [#83164]
[#83164]: https://github.com/rust-lang/rust/issues/83164
------------------------
"##,
},
Lint {
label: "const_result",
description: r##"# `const_result`
The tracking issue for this feature is: [#82814]
[#82814]: https://github.com/rust-lang/rust/issues/82814
------------------------
"##,
},
Lint {
label: "const_size_of_val",
description: r##"# `const_size_of_val`
The tracking issue for this feature is: [#46571]
[#46571]: https://github.com/rust-lang/rust/issues/46571
------------------------
"##,
},
Lint {
label: "const_size_of_val_raw",
description: r##"# `const_size_of_val_raw`
The tracking issue for this feature is: [#46571]
[#46571]: https://github.com/rust-lang/rust/issues/46571
------------------------
"##,
},
Lint {
label: "const_slice_first_last",
description: r##"# `const_slice_first_last`
The tracking issue for this feature is: [#83570]
[#83570]: https://github.com/rust-lang/rust/issues/83570
------------------------
"##,
},
Lint {
label: "const_slice_first_last_chunk",
description: r##"# `const_slice_first_last_chunk`
The tracking issue for this feature is: [#111774]
[#111774]: https://github.com/rust-lang/rust/issues/111774
------------------------
"##,
},
Lint {
label: "const_slice_flatten",
description: r##"# `const_slice_flatten`
The tracking issue for this feature is: [#95629]
[#95629]: https://github.com/rust-lang/rust/issues/95629
------------------------
"##,
},
Lint {
label: "const_slice_from_mut_ptr_range",
description: r##"# `const_slice_from_mut_ptr_range`
The tracking issue for this feature is: [#89792]
[#89792]: https://github.com/rust-lang/rust/issues/89792
------------------------
"##,
},
Lint {
label: "const_slice_from_ptr_range",
description: r##"# `const_slice_from_ptr_range`
The tracking issue for this feature is: [#89792]
[#89792]: https://github.com/rust-lang/rust/issues/89792
------------------------
"##,
},
Lint {
label: "const_slice_from_raw_parts_mut",
description: r##"# `const_slice_from_raw_parts_mut`
The tracking issue for this feature is: [#67456]
[#67456]: https://github.com/rust-lang/rust/issues/67456
------------------------
"##,
},
Lint {
label: "const_slice_from_ref",
description: r##"# `const_slice_from_ref`
The tracking issue for this feature is: [#90206]
[#90206]: https://github.com/rust-lang/rust/issues/90206
------------------------
"##,
},
Lint {
label: "const_slice_index",
description: r##"# `const_slice_index`
This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
------------------------
"##,
},
Lint {
label: "const_slice_split_at_mut",
description: r##"# `const_slice_split_at_mut`
The tracking issue for this feature is: [#101804]
[#101804]: https://github.com/rust-lang/rust/issues/101804
------------------------
"##,
},
Lint {
label: "const_str_from_raw_parts_mut",
description: r##"# `const_str_from_raw_parts_mut`
The tracking issue for this feature is: [#119206]
[#119206]: https://github.com/rust-lang/rust/issues/119206
------------------------
"##,
},
Lint {
label: "const_str_from_utf8",
description: r##"# `const_str_from_utf8`
The tracking issue for this feature is: [#91006]
[#91006]: https://github.com/rust-lang/rust/issues/91006
------------------------
"##,
},
Lint {
label: "const_str_from_utf8_unchecked_mut",
description: r##"# `const_str_from_utf8_unchecked_mut`
The tracking issue for this feature is: [#91005]
[#91005]: https://github.com/rust-lang/rust/issues/91005
------------------------
"##,
},
Lint {
label: "const_strict_overflow_ops",
description: r##"# `const_strict_overflow_ops`
The tracking issue for this feature is: [#118260]
[#118260]: https://github.com/rust-lang/rust/issues/118260
------------------------
"##,
},
Lint {
label: "const_swap",
description: r##"# `const_swap`
The tracking issue for this feature is: [#83163]
[#83163]: https://github.com/rust-lang/rust/issues/83163
------------------------
"##,
},
Lint {
label: "const_three_way_compare",
description: r##"# `const_three_way_compare`
This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
------------------------
"##,
},
Lint {
label: "const_trait_impl",
description: r##"# `const_trait_impl`
The tracking issue for this feature is: [#67792]
[#67792]: https://github.com/rust-lang/rust/issues/67792
------------------------
"##,
},
Lint {
label: "const_try",
description: r##"# `const_try`
The tracking issue for this feature is: [#74935]
[#74935]: https://github.com/rust-lang/rust/issues/74935
------------------------
"##,
},
Lint {
label: "const_type_id",
description: r##"# `const_type_id`
The tracking issue for this feature is: [#77125]
[#77125]: https://github.com/rust-lang/rust/issues/77125
------------------------
"##,
},
Lint {
label: "const_type_name",
description: r##"# `const_type_name`
The tracking issue for this feature is: [#63084]
[#63084]: https://github.com/rust-lang/rust/issues/63084
------------------------
"##,
},
Lint {
label: "const_typed_swap",
description: r##"# `const_typed_swap`
This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
------------------------
"##,
},
Lint {
label: "const_ub_checks",
description: r##"# `const_ub_checks`
This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
------------------------
"##,
},
Lint {
label: "const_unicode_case_lookup",
description: r##"# `const_unicode_case_lookup`
The tracking issue for this feature is: [#101400]
[#101400]: https://github.com/rust-lang/rust/issues/101400
------------------------
"##,
},
Lint {
label: "const_unsafecell_get_mut",
description: r##"# `const_unsafecell_get_mut`
The tracking issue for this feature is: [#88836]
[#88836]: https://github.com/rust-lang/rust/issues/88836
------------------------
"##,
},
Lint {
label: "const_waker",
description: r##"# `const_waker`
The tracking issue for this feature is: [#102012]
[#102012]: https://github.com/rust-lang/rust/issues/102012
------------------------
"##,
},
Lint {
label: "container_error_extra",
description: r##"# `container_error_extra`
This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
------------------------
"##,
},
Lint {
label: "context_ext",
description: r##"# `context_ext`
The tracking issue for this feature is: [#123392]
[#123392]: https://github.com/rust-lang/rust/issues/123392
------------------------
"##,
},
Lint {
label: "control_flow_enum",
description: r##"# `control_flow_enum`
The tracking issue for this feature is: [#75744]
[#75744]: https://github.com/rust-lang/rust/issues/75744
------------------------
"##,
},
Lint {
label: "convert_float_to_int",
description: r##"# `convert_float_to_int`
The tracking issue for this feature is: [#67057]
[#67057]: https://github.com/rust-lang/rust/issues/67057
------------------------
"##,
},
Lint {
label: "core_intrinsics",
description: r##"# `core_intrinsics`
This feature is internal to the Rust compiler and is not intended for general use.
------------------------
"##,
},
Lint {
label: "core_io_borrowed_buf",
description: r##"# `core_io_borrowed_buf`
The tracking issue for this feature is: [#117693]
[#117693]: https://github.com/rust-lang/rust/issues/117693
------------------------
"##,
},
Lint {
label: "core_pattern_type",
description: r##"# `core_pattern_type`
This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
------------------------
"##,
},
Lint {
label: "core_pattern_types",
description: r##"# `core_pattern_types`
This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
------------------------
"##,
},
Lint {
label: "core_private_bignum",
description: r##"# `core_private_bignum`
This feature is internal to the Rust compiler and is not intended for general use.
------------------------
"##,
},
Lint {
label: "core_private_diy_float",
description: r##"# `core_private_diy_float`
This feature is internal to the Rust compiler and is not intended for general use.
------------------------
"##,
},
Lint {
label: "coroutine_clone",
description: r##"# `coroutine_clone`
The tracking issue for this feature is: [#95360]
[#95360]: https://github.com/rust-lang/rust/issues/95360
------------------------
"##,
},
Lint {
label: "coroutine_trait",
description: r##"# `coroutine_trait`
The tracking issue for this feature is: [#43122]
[#43122]: https://github.com/rust-lang/rust/issues/43122
------------------------
"##,
},
Lint {
label: "coroutines",
description: r##"# `coroutines`
The tracking issue for this feature is: [#43122]
[#43122]: https://github.com/rust-lang/rust/issues/43122
------------------------
The `coroutines` feature gate in Rust allows you to define coroutine or
coroutine literals. A coroutine is a "resumable function" that syntactically
resembles a closure but compiles to much different semantics in the compiler
itself. The primary feature of a coroutine is that it can be suspended during
execution to be resumed at a later date. Coroutines use the `yield` keyword to
"return", and then the caller can `resume` a coroutine to resume execution just
after the `yield` keyword.
Coroutines are an extra-unstable feature in the compiler right now. Added in
[RFC 2033] they're mostly intended right now as a information/constraint
gathering phase. The intent is that experimentation can happen on the nightly
compiler before actual stabilization. A further RFC will be required to
stabilize coroutines and will likely contain at least a few small
tweaks to the overall design.
[RFC 2033]: https://github.com/rust-lang/rfcs/pull/2033
A syntactical example of a coroutine is:
```rust
#![feature(coroutines, coroutine_trait, stmt_expr_attributes)]
use std::ops::{Coroutine, CoroutineState};
use std::pin::Pin;
fn main() {
let mut coroutine = #[coroutine] || {
yield 1;
return "foo"
};
match Pin::new(&mut coroutine).resume(()) {
CoroutineState::Yielded(1) => {}
_ => panic!("unexpected value from resume"),
}
match Pin::new(&mut coroutine).resume(()) {
CoroutineState::Complete("foo") => {}
_ => panic!("unexpected value from resume"),
}
}
```
Coroutines are closure-like literals which are annotated with `#[coroutine]`
and can contain a `yield` statement. The
`yield` statement takes an optional expression of a value to yield out of the
coroutine. All coroutine literals implement the `Coroutine` trait in the
`std::ops` module. The `Coroutine` trait has one main method, `resume`, which
resumes execution of the coroutine at the previous suspension point.
An example of the control flow of coroutines is that the following example
prints all numbers in order:
```rust
#![feature(coroutines, coroutine_trait, stmt_expr_attributes)]
use std::ops::Coroutine;
use std::pin::Pin;
fn main() {
let mut coroutine = #[coroutine] || {
println!("2");
yield;
println!("4");
};
println!("1");
Pin::new(&mut coroutine).resume(());
println!("3");
Pin::new(&mut coroutine).resume(());
println!("5");
}
```
At this time the main use case of coroutines is an implementation
primitive for `async`/`await` and `gen` syntax, but coroutines
will likely be extended to other primitives in the future.
Feedback on the design and usage is always appreciated!
### The `Coroutine` trait
The `Coroutine` trait in `std::ops` currently looks like:
```rust
# #![feature(arbitrary_self_types, coroutine_trait)]
# use std::ops::CoroutineState;
# use std::pin::Pin;
pub trait Coroutine<R = ()> {
type Yield;
type Return;
fn resume(self: Pin<&mut Self>, resume: R) -> CoroutineState<Self::Yield, Self::Return>;
}
```
The `Coroutine::Yield` type is the type of values that can be yielded with the
`yield` statement. The `Coroutine::Return` type is the returned type of the
coroutine. This is typically the last expression in a coroutine's definition or
any value passed to `return` in a coroutine. The `resume` function is the entry
point for executing the `Coroutine` itself.
The return value of `resume`, `CoroutineState`, looks like:
```rust
pub enum CoroutineState<Y, R> {
Yielded(Y),
Complete(R),
}
```
The `Yielded` variant indicates that the coroutine can later be resumed. This
corresponds to a `yield` point in a coroutine. The `Complete` variant indicates
that the coroutine is complete and cannot be resumed again. Calling `resume`
after a coroutine has returned `Complete` will likely result in a panic of the
program.
### Closure-like semantics
The closure-like syntax for coroutines alludes to the fact that they also have
closure-like semantics. Namely:
* When created, a coroutine executes no code. A closure literal does not
actually execute any of the closure's code on construction, and similarly a
coroutine literal does not execute any code inside the coroutine when
constructed.
* Coroutines can capture outer variables by reference or by move, and this can
be tweaked with the `move` keyword at the beginning of the closure. Like
closures all coroutines will have an implicit environment which is inferred by
the compiler. Outer variables can be moved into a coroutine for use as the
coroutine progresses.
* Coroutine literals produce a value with a unique type which implements the
`std::ops::Coroutine` trait. This allows actual execution of the coroutine
through the `Coroutine::resume` method as well as also naming it in return
types and such.
* Traits like `Send` and `Sync` are automatically implemented for a `Coroutine`
depending on the captured variables of the environment. Unlike closures,
coroutines also depend on variables live across suspension points. This means
that although the ambient environment may be `Send` or `Sync`, the coroutine
itself may not be due to internal variables live across `yield` points being
not-`Send` or not-`Sync`. Note that coroutines do
not implement traits like `Copy` or `Clone` automatically.
* Whenever a coroutine is dropped it will drop all captured environment
variables.
### Coroutines as state machines
In the compiler, coroutines are currently compiled as state machines. Each
`yield` expression will correspond to a different state that stores all live
variables over that suspension point. Resumption of a coroutine will dispatch on
the current state and then execute internally until a `yield` is reached, at
which point all state is saved off in the coroutine and a value is returned.
Let's take a look at an example to see what's going on here:
```rust
#![feature(coroutines, coroutine_trait, stmt_expr_attributes)]
use std::ops::Coroutine;
use std::pin::Pin;
fn main() {
let ret = "foo";
let mut coroutine = #[coroutine] move || {
yield 1;
return ret
};
Pin::new(&mut coroutine).resume(());
Pin::new(&mut coroutine).resume(());
}
```
This coroutine literal will compile down to something similar to:
```rust
#![feature(arbitrary_self_types, coroutine_trait)]
use std::ops::{Coroutine, CoroutineState};
use std::pin::Pin;
fn main() {
let ret = "foo";
let mut coroutine = {
enum __Coroutine {
Start(&'static str),
Yield1(&'static str),
Done,
}
impl Coroutine for __Coroutine {
type Yield = i32;
type Return = &'static str;
fn resume(mut self: Pin<&mut Self>, resume: ()) -> CoroutineState<i32, &'static str> {
use std::mem;
match mem::replace(&mut *self, __Coroutine::Done) {
__Coroutine::Start(s) => {
*self = __Coroutine::Yield1(s);
CoroutineState::Yielded(1)
}
__Coroutine::Yield1(s) => {
*self = __Coroutine::Done;
CoroutineState::Complete(s)
}
__Coroutine::Done => {
panic!("coroutine resumed after completion")
}
}
}
}
__Coroutine::Start(ret)
};
Pin::new(&mut coroutine).resume(());
Pin::new(&mut coroutine).resume(());
}
```
Notably here we can see that the compiler is generating a fresh type,
`__Coroutine` in this case. This type has a number of states (represented here
as an `enum`) corresponding to each of the conceptual states of the coroutine.
At the beginning we're closing over our outer variable `foo` and then that
variable is also live over the `yield` point, so it's stored in both states.
When the coroutine starts it'll immediately yield 1, but it saves off its state
just before it does so indicating that it has reached the yield point. Upon
resuming again we'll execute the `return ret` which returns the `Complete`
state.
Here we can also note that the `Done` state, if resumed, panics immediately as
it's invalid to resume a completed coroutine. It's also worth noting that this
is just a rough desugaring, not a normative specification for what the compiler
does.
"##,
},
Lint {
label: "coverage_attribute",
description: r##"# `coverage_attribute`
The tracking issue for this feature is: [#84605]
[#84605]: https://github.com/rust-lang/rust/issues/84605
---
The `coverage` attribute can be used to selectively disable coverage
instrumentation in an annotated function. This might be useful to:
- Avoid instrumentation overhead in a performance critical function
- Avoid generating coverage for a function that is not meant to be executed,
but still target 100% coverage for the rest of the program.
## Example
```rust
#![feature(coverage_attribute)]
// `foo()` will get coverage instrumentation (by default)
fn foo() {
// ...
}
#[coverage(off)]
fn bar() {
// ...
}
```
"##,
},
Lint {
label: "cow_is_borrowed",
description: r##"# `cow_is_borrowed`
The tracking issue for this feature is: [#65143]
[#65143]: https://github.com/rust-lang/rust/issues/65143
------------------------
"##,
},
Lint {
label: "csky_target_feature",
description: r##"# `csky_target_feature`
The tracking issue for this feature is: [#44839]
[#44839]: https://github.com/rust-lang/rust/issues/44839
------------------------
"##,
},
Lint {
label: "cstr_bytes",
description: r##"# `cstr_bytes`
The tracking issue for this feature is: [#112115]
[#112115]: https://github.com/rust-lang/rust/issues/112115
------------------------
"##,
},
Lint {
label: "cstr_internals",
description: r##"# `cstr_internals`
This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
------------------------
"##,
},
Lint {
label: "cursor_remaining",
description: r##"# `cursor_remaining`
The