summaryrefslogtreecommitdiffstats
path: root/compiler/rustc_lint_defs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-18 02:49:50 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-18 02:49:50 +0000
commit9835e2ae736235810b4ea1c162ca5e65c547e770 (patch)
tree3fcebf40ed70e581d776a8a4c65923e8ec20e026 /compiler/rustc_lint_defs
parentReleasing progress-linux version 1.70.0+dfsg2-1~progress7.99u1. (diff)
downloadrustc-9835e2ae736235810b4ea1c162ca5e65c547e770.tar.xz
rustc-9835e2ae736235810b4ea1c162ca5e65c547e770.zip
Merging upstream version 1.71.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'compiler/rustc_lint_defs')
-rw-r--r--compiler/rustc_lint_defs/src/builtin.rs192
-rw-r--r--compiler/rustc_lint_defs/src/lib.rs3
2 files changed, 101 insertions, 94 deletions
diff --git a/compiler/rustc_lint_defs/src/builtin.rs b/compiler/rustc_lint_defs/src/builtin.rs
index 9d6ab0b75..6e9dc880a 100644
--- a/compiler/rustc_lint_defs/src/builtin.rs
+++ b/compiler/rustc_lint_defs/src/builtin.rs
@@ -333,6 +333,7 @@ declare_lint! {
///
/// ```rust,compile_fail
/// #![deny(unused_extern_crates)]
+ /// #![deny(warnings)]
/// extern crate proc_macro;
/// ```
///
@@ -1021,7 +1022,7 @@ declare_lint! {
declare_lint! {
/// The `invalid_alignment` lint detects dereferences of misaligned pointers during
- /// constant evluation.
+ /// constant evaluation.
///
/// ### Example
///
@@ -1667,6 +1668,7 @@ declare_lint! {
///
/// ```rust,compile_fail
/// #![deny(elided_lifetimes_in_paths)]
+ /// #![deny(warnings)]
/// struct Foo<'a> {
/// x: &'a u32
/// }
@@ -1854,7 +1856,7 @@ declare_lint! {
/// When new methods are added to traits in the standard library, they are
/// usually added in an "unstable" form which is only available on the
/// [nightly channel] with a [`feature` attribute]. If there is any
- /// pre-existing code which extends a trait to have a method with the same
+ /// preexisting code which extends a trait to have a method with the same
/// name, then the names will collide. In the future, when the method is
/// stabilized, this will cause an error due to the ambiguity. This lint
/// is an early-warning to let you know that there may be a collision in
@@ -2158,6 +2160,7 @@ declare_lint! {
/// ```rust,compile_fail
/// # #![allow(unused)]
/// #![deny(explicit_outlives_requirements)]
+ /// #![deny(warnings)]
///
/// struct SharedRef<'a, T>
/// where
@@ -3273,110 +3276,115 @@ declare_lint_pass! {
/// Does nothing as a lint pass, but registers some `Lint`s
/// that are used by other parts of the compiler.
HardwiredLints => [
- FORBIDDEN_LINT_GROUPS,
- ILLEGAL_FLOATING_POINT_LITERAL_PATTERN,
+ // tidy-alphabetical-start
+ ABSOLUTE_PATHS_NOT_STARTING_WITH_CRATE,
+ AMBIGUOUS_ASSOCIATED_ITEMS,
+ AMBIGUOUS_GLOB_REEXPORTS,
ARITHMETIC_OVERFLOW,
- UNCONDITIONAL_PANIC,
- UNUSED_IMPORTS,
- UNUSED_EXTERN_CRATES,
- UNUSED_CRATE_DEPENDENCIES,
- UNUSED_QUALIFICATIONS,
- UNKNOWN_LINTS,
- UNFULFILLED_LINT_EXPECTATIONS,
- UNUSED_VARIABLES,
- UNUSED_ASSIGNMENTS,
- DEAD_CODE,
- UNREACHABLE_CODE,
- UNREACHABLE_PATTERNS,
- OVERLAPPING_RANGE_ENDPOINTS,
+ ASM_SUB_REGISTER,
+ BAD_ASM_STYLE,
+ BARE_TRAIT_OBJECTS,
BINDINGS_WITH_VARIANT_NAME,
- UNUSED_MACROS,
- UNUSED_MACRO_RULES,
- WARNINGS,
- UNUSED_FEATURES,
- STABLE_FEATURES,
- UNKNOWN_CRATE_TYPES,
- TRIVIAL_CASTS,
- TRIVIAL_NUMERIC_CASTS,
- PRIVATE_IN_PUBLIC,
- EXPORTED_PRIVATE_DEPENDENCIES,
- PUB_USE_OF_PRIVATE_EXTERN_CRATE,
- INVALID_TYPE_PARAM_DEFAULT,
- RENAMED_AND_REMOVED_LINTS,
- CONST_ITEM_MUTATION,
- PATTERNS_IN_FNS_WITHOUT_BODY,
- MISSING_FRAGMENT_SPECIFIER,
- LATE_BOUND_LIFETIME_ARGUMENTS,
- ORDER_DEPENDENT_TRAIT_OBJECTS,
+ BREAK_WITH_LABEL_AND_LOOP,
+ BYTE_SLICE_IN_PACKED_STRUCT_WITH_DERIVE,
+ CENUM_IMPL_DROP_CAST,
COHERENCE_LEAK_CHECK,
+ CONFLICTING_REPR_HINTS,
+ CONST_EVALUATABLE_UNCHECKED,
+ CONST_ITEM_MUTATION,
+ DEAD_CODE,
DEPRECATED,
- UNUSED_UNSAFE,
- UNUSED_MUT,
- UNCONDITIONAL_RECURSION,
- SINGLE_USE_LIFETIMES,
- UNUSED_LIFETIMES,
- UNUSED_LABELS,
- TYVAR_BEHIND_RAW_POINTER,
+ DEPRECATED_CFG_ATTR_CRATE_TYPE_NAME,
+ DEPRECATED_IN_FUTURE,
+ DEPRECATED_WHERE_CLAUSE_LOCATION,
+ DUPLICATE_MACRO_ATTRIBUTES,
ELIDED_LIFETIMES_IN_PATHS,
- BARE_TRAIT_OBJECTS,
- ABSOLUTE_PATHS_NOT_STARTING_WITH_CRATE,
- UNSTABLE_NAME_COLLISIONS,
- IRREFUTABLE_LET_PATTERNS,
- WHERE_CLAUSES_OBJECT_SAFETY,
- PROC_MACRO_DERIVE_RESOLUTION_FALLBACK,
- MACRO_USE_EXTERN_CRATE,
- MACRO_EXPANDED_MACRO_EXPORTS_ACCESSED_BY_ABSOLUTE_PATHS,
+ EXPORTED_PRIVATE_DEPENDENCIES,
+ FFI_UNWIND_CALLS,
+ FORBIDDEN_LINT_GROUPS,
+ FUNCTION_ITEM_REFERENCES,
+ FUZZY_PROVENANCE_CASTS,
ILL_FORMED_ATTRIBUTE_INPUT,
- CONFLICTING_REPR_HINTS,
- META_VARIABLE_MISUSE,
- DEPRECATED_IN_FUTURE,
- AMBIGUOUS_ASSOCIATED_ITEMS,
- INDIRECT_STRUCTURAL_MATCH,
- POINTER_STRUCTURAL_MATCH,
- NONTRIVIAL_STRUCTURAL_MATCH,
- SOFT_UNSTABLE,
- UNSTABLE_SYNTAX_PRE_EXPANSION,
- INLINE_NO_SANITIZE,
- BAD_ASM_STYLE,
- ASM_SUB_REGISTER,
- UNSAFE_OP_IN_UNSAFE_FN,
+ ILLEGAL_FLOATING_POINT_LITERAL_PATTERN,
+ IMPLIED_BOUNDS_ENTAILMENT,
INCOMPLETE_INCLUDE,
- CENUM_IMPL_DROP_CAST,
- FUZZY_PROVENANCE_CASTS,
- LOSSY_PROVENANCE_CASTS,
- CONST_EVALUATABLE_UNCHECKED,
+ INDIRECT_STRUCTURAL_MATCH,
INEFFECTIVE_UNSTABLE_TRAIT_IMPL,
- MUST_NOT_SUSPEND,
- UNINHABITED_STATIC,
- FUNCTION_ITEM_REFERENCES,
- USELESS_DEPRECATED,
- MISSING_ABI,
+ INLINE_NO_SANITIZE,
+ INVALID_ALIGNMENT,
INVALID_DOC_ATTRIBUTES,
- SEMICOLON_IN_EXPRESSIONS_FROM_MACROS,
- RUST_2021_INCOMPATIBLE_CLOSURE_CAPTURES,
+ INVALID_MACRO_EXPORT_ARGUMENTS,
+ INVALID_TYPE_PARAM_DEFAULT,
+ IRREFUTABLE_LET_PATTERNS,
+ LARGE_ASSIGNMENTS,
+ LATE_BOUND_LIFETIME_ARGUMENTS,
LEGACY_DERIVE_HELPERS,
+ LOSSY_PROVENANCE_CASTS,
+ MACRO_EXPANDED_MACRO_EXPORTS_ACCESSED_BY_ABSOLUTE_PATHS,
+ MACRO_USE_EXTERN_CRATE,
+ META_VARIABLE_MISUSE,
+ MISSING_ABI,
+ MISSING_FRAGMENT_SPECIFIER,
+ MUST_NOT_SUSPEND,
+ NAMED_ARGUMENTS_USED_POSITIONALLY,
+ NON_EXHAUSTIVE_OMITTED_PATTERNS,
+ NONTRIVIAL_STRUCTURAL_MATCH,
+ ORDER_DEPENDENT_TRAIT_OBJECTS,
+ OVERLAPPING_RANGE_ENDPOINTS,
+ PATTERNS_IN_FNS_WITHOUT_BODY,
+ POINTER_STRUCTURAL_MATCH,
+ PRIVATE_IN_PUBLIC,
PROC_MACRO_BACK_COMPAT,
+ PROC_MACRO_DERIVE_RESOLUTION_FALLBACK,
+ PUB_USE_OF_PRIVATE_EXTERN_CRATE,
+ RENAMED_AND_REMOVED_LINTS,
+ REPR_TRANSPARENT_EXTERNAL_PRIVATE_FIELDS,
+ RUST_2021_INCOMPATIBLE_CLOSURE_CAPTURES,
RUST_2021_INCOMPATIBLE_OR_PATTERNS,
- LARGE_ASSIGNMENTS,
- RUST_2021_PRELUDE_COLLISIONS,
RUST_2021_PREFIXES_INCOMPATIBLE_SYNTAX,
+ RUST_2021_PRELUDE_COLLISIONS,
+ SEMICOLON_IN_EXPRESSIONS_FROM_MACROS,
+ SINGLE_USE_LIFETIMES,
+ SOFT_UNSTABLE,
+ STABLE_FEATURES,
+ SUSPICIOUS_AUTO_TRAIT_IMPLS,
+ TEST_UNSTABLE_LINT,
+ TEXT_DIRECTION_CODEPOINT_IN_COMMENT,
+ TRIVIAL_CASTS,
+ TRIVIAL_NUMERIC_CASTS,
+ TYVAR_BEHIND_RAW_POINTER,
+ UNCONDITIONAL_PANIC,
+ UNCONDITIONAL_RECURSION,
+ UNDEFINED_NAKED_FUNCTION_ABI,
+ UNFULFILLED_LINT_EXPECTATIONS,
+ UNINHABITED_STATIC,
+ UNKNOWN_CRATE_TYPES,
+ UNKNOWN_LINTS,
+ UNREACHABLE_CODE,
+ UNREACHABLE_PATTERNS,
+ UNSAFE_OP_IN_UNSAFE_FN,
+ UNSTABLE_NAME_COLLISIONS,
+ UNSTABLE_SYNTAX_PRE_EXPANSION,
UNSUPPORTED_CALLING_CONVENTIONS,
- BREAK_WITH_LABEL_AND_LOOP,
+ UNUSED_ASSIGNMENTS,
UNUSED_ATTRIBUTES,
+ UNUSED_CRATE_DEPENDENCIES,
+ UNUSED_EXTERN_CRATES,
+ UNUSED_FEATURES,
+ UNUSED_IMPORTS,
+ UNUSED_LABELS,
+ UNUSED_LIFETIMES,
+ UNUSED_MACRO_RULES,
+ UNUSED_MACROS,
+ UNUSED_MUT,
+ UNUSED_QUALIFICATIONS,
UNUSED_TUPLE_STRUCT_FIELDS,
- NON_EXHAUSTIVE_OMITTED_PATTERNS,
- TEXT_DIRECTION_CODEPOINT_IN_COMMENT,
- DEPRECATED_CFG_ATTR_CRATE_TYPE_NAME,
- DUPLICATE_MACRO_ATTRIBUTES,
- SUSPICIOUS_AUTO_TRAIT_IMPLS,
- DEPRECATED_WHERE_CLAUSE_LOCATION,
- TEST_UNSTABLE_LINT,
- FFI_UNWIND_CALLS,
- REPR_TRANSPARENT_EXTERNAL_PRIVATE_FIELDS,
- NAMED_ARGUMENTS_USED_POSITIONALLY,
- IMPLIED_BOUNDS_ENTAILMENT,
- BYTE_SLICE_IN_PACKED_STRUCT_WITH_DERIVE,
- AMBIGUOUS_GLOB_REEXPORTS,
+ UNUSED_UNSAFE,
+ UNUSED_VARIABLES,
+ USELESS_DEPRECATED,
+ WARNINGS,
+ WHERE_CLAUSES_OBJECT_SAFETY,
+ // tidy-alphabetical-end
]
}
@@ -4009,7 +4017,6 @@ declare_lint! {
/// ### Example
///
/// ```rust
- /// #![feature(c_unwind)]
/// #![warn(ffi_unwind_calls)]
///
/// extern "C-unwind" {
@@ -4032,8 +4039,7 @@ declare_lint! {
/// that desire this ability it is therefore necessary to avoid such calls.
pub FFI_UNWIND_CALLS,
Allow,
- "call to foreign functions or function pointers with FFI-unwind ABI",
- @feature_gate = sym::c_unwind;
+ "call to foreign functions or function pointers with FFI-unwind ABI"
}
declare_lint! {
diff --git a/compiler/rustc_lint_defs/src/lib.rs b/compiler/rustc_lint_defs/src/lib.rs
index 7ea472ed5..e27e322db 100644
--- a/compiler/rustc_lint_defs/src/lib.rs
+++ b/compiler/rustc_lint_defs/src/lib.rs
@@ -496,7 +496,8 @@ pub enum BuiltinLintDiagnostics {
BreakWithLabelAndLoop(Span),
NamedAsmLabel(String),
UnicodeTextFlow(Span, String),
- UnexpectedCfg((Symbol, Span), Option<(Symbol, Span)>),
+ UnexpectedCfgName((Symbol, Span), Option<(Symbol, Span)>),
+ UnexpectedCfgValue((Symbol, Span), Option<(Symbol, Span)>),
DeprecatedWhereclauseLocation(Span, String),
SingleUseLifetime {
/// Span of the parameter which declares this lifetime.