Skip to content

Decouple "reporting in deps" from FutureIncompatibilityReason #141936

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion compiler/rustc_lint/src/levels.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ fn lints_that_dont_need_to_run(tcx: TyCtxt<'_>, (): ()) -> UnordSet<LintId> {
.filter(|lint| {
// Lints that show up in future-compat reports must always be run.
let has_future_breakage =
lint.future_incompatible.is_some_and(|fut| fut.reason.has_future_breakage());
lint.future_incompatible.is_some_and(|fut| fut.report_in_deps);
!has_future_breakage && !lint.eval_always
})
.filter(|lint| {
Expand Down
65 changes: 38 additions & 27 deletions compiler/rustc_lint_defs/src/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,9 @@ declare_lint! {
Warn,
"applying forbid to lint-groups",
@future_incompatible = FutureIncompatibleInfo {
reason: FutureIncompatibilityReason::FutureReleaseErrorReportInDeps,
reason: FutureIncompatibilityReason::FutureReleaseError,
reference: "issue #81670 <https://github.com/rust-lang/rust/issues/81670>",
report_in_deps: true,
};
}

Expand Down Expand Up @@ -214,7 +215,7 @@ declare_lint! {
Deny,
"ill-formed attribute inputs that were previously accepted and used in practice",
@future_incompatible = FutureIncompatibleInfo {
reason: FutureIncompatibilityReason::FutureReleaseErrorDontReportInDeps,
reason: FutureIncompatibilityReason::FutureReleaseError,
reference: "issue #57571 <https://github.com/rust-lang/rust/issues/57571>",
};
crate_level_only
Expand Down Expand Up @@ -251,8 +252,9 @@ declare_lint! {
Deny,
"conflicts between `#[repr(..)]` hints that were previously accepted and used in practice",
@future_incompatible = FutureIncompatibleInfo {
reason: FutureIncompatibilityReason::FutureReleaseErrorReportInDeps,
reason: FutureIncompatibilityReason::FutureReleaseError,
reference: "issue #68585 <https://github.com/rust-lang/rust/issues/68585>",
report_in_deps: true,
};
}

Expand Down Expand Up @@ -1240,8 +1242,9 @@ declare_lint! {
Deny,
"detect public re-exports of private extern crates",
@future_incompatible = FutureIncompatibleInfo {
reason: FutureIncompatibilityReason::FutureReleaseErrorReportInDeps,
reason: FutureIncompatibilityReason::FutureReleaseError,
reference: "issue #127909 <https://github.com/rust-lang/rust/issues/127909>",
report_in_deps: true,
};
}

Expand Down Expand Up @@ -1270,8 +1273,9 @@ declare_lint! {
Deny,
"type parameter default erroneously allowed in invalid location",
@future_incompatible = FutureIncompatibleInfo {
reason: FutureIncompatibilityReason::FutureReleaseErrorReportInDeps,
reason: FutureIncompatibilityReason::FutureReleaseError,
reference: "issue #36887 <https://github.com/rust-lang/rust/issues/36887>",
report_in_deps: true,
};
}

Expand Down Expand Up @@ -1409,7 +1413,7 @@ declare_lint! {
Deny,
"patterns in functions without body were erroneously allowed",
@future_incompatible = FutureIncompatibleInfo {
reason: FutureIncompatibilityReason::FutureReleaseErrorDontReportInDeps,
reason: FutureIncompatibilityReason::FutureReleaseError,
reference: "issue #35203 <https://github.com/rust-lang/rust/issues/35203>",
};
}
Expand Down Expand Up @@ -1453,8 +1457,9 @@ declare_lint! {
Deny,
"detects missing fragment specifiers in unused `macro_rules!` patterns",
@future_incompatible = FutureIncompatibleInfo {
reason: FutureIncompatibilityReason::FutureReleaseErrorReportInDeps,
reason: FutureIncompatibilityReason::FutureReleaseError,
reference: "issue #40107 <https://github.com/rust-lang/rust/issues/40107>",
report_in_deps: true,
};
}

Expand Down Expand Up @@ -1495,7 +1500,7 @@ declare_lint! {
Warn,
"detects generic lifetime arguments in path segments with late bound lifetime parameters",
@future_incompatible = FutureIncompatibleInfo {
reason: FutureIncompatibilityReason::FutureReleaseErrorDontReportInDeps,
reason: FutureIncompatibilityReason::FutureReleaseError,
reference: "issue #42868 <https://github.com/rust-lang/rust/issues/42868>",
};
}
Expand Down Expand Up @@ -2122,8 +2127,9 @@ declare_lint! {
Deny,
"detects proc macro derives using inaccessible names from parent modules",
@future_incompatible = FutureIncompatibleInfo {
reason: FutureIncompatibilityReason::FutureReleaseErrorReportInDeps,
reason: FutureIncompatibilityReason::FutureReleaseError,
reference: "issue #83583 <https://github.com/rust-lang/rust/issues/83583>",
report_in_deps: true,
};
}

Expand Down Expand Up @@ -2225,7 +2231,7 @@ declare_lint! {
"macro-expanded `macro_export` macros from the current crate \
cannot be referred to by absolute paths",
@future_incompatible = FutureIncompatibleInfo {
reason: FutureIncompatibilityReason::FutureReleaseErrorDontReportInDeps,
reason: FutureIncompatibilityReason::FutureReleaseError,
reference: "issue #52234 <https://github.com/rust-lang/rust/issues/52234>",
};
crate_level_only
Expand Down Expand Up @@ -2346,7 +2352,7 @@ declare_lint! {
Deny,
"ambiguous associated items",
@future_incompatible = FutureIncompatibleInfo {
reason: FutureIncompatibilityReason::FutureReleaseErrorDontReportInDeps,
reason: FutureIncompatibilityReason::FutureReleaseError,
reference: "issue #57644 <https://github.com/rust-lang/rust/issues/57644>",
};
}
Expand All @@ -2362,8 +2368,9 @@ declare_lint! {
Deny,
"a feature gate that doesn't break dependent crates",
@future_incompatible = FutureIncompatibleInfo {
reason: FutureIncompatibilityReason::FutureReleaseErrorReportInDeps,
reason: FutureIncompatibilityReason::FutureReleaseError,
reference: "issue #64266 <https://github.com/rust-lang/rust/issues/64266>",
report_in_deps: true,
};
}

Expand Down Expand Up @@ -2674,7 +2681,7 @@ declare_lint! {
Warn,
"detects a generic constant is used in a type without a emitting a warning",
@future_incompatible = FutureIncompatibleInfo {
reason: FutureIncompatibilityReason::FutureReleaseErrorDontReportInDeps,
reason: FutureIncompatibilityReason::FutureReleaseError,
reference: "issue #76200 <https://github.com/rust-lang/rust/issues/76200>",
};
}
Expand Down Expand Up @@ -2733,7 +2740,7 @@ declare_lint! {
Warn,
"uninhabited static",
@future_incompatible = FutureIncompatibleInfo {
reason: FutureIncompatibilityReason::FutureReleaseErrorDontReportInDeps,
reason: FutureIncompatibilityReason::FutureReleaseError,
reference: "issue #74840 <https://github.com/rust-lang/rust/issues/74840>",
};
}
Expand Down Expand Up @@ -2866,7 +2873,7 @@ declare_lint! {
Warn,
"detect unsupported use of `Self` from outer item",
@future_incompatible = FutureIncompatibleInfo {
reason: FutureIncompatibilityReason::FutureReleaseErrorDontReportInDeps,
reason: FutureIncompatibilityReason::FutureReleaseError,
reference: "issue #124186 <https://github.com/rust-lang/rust/issues/124186>",
};
}
Expand Down Expand Up @@ -2912,8 +2919,9 @@ declare_lint! {
Warn,
"trailing semicolon in macro body used as expression",
@future_incompatible = FutureIncompatibleInfo {
reason: FutureIncompatibilityReason::FutureReleaseErrorReportInDeps,
reason: FutureIncompatibilityReason::FutureReleaseError,
reference: "issue #79813 <https://github.com/rust-lang/rust/issues/79813>",
report_in_deps: true,
};
}

Expand Down Expand Up @@ -2959,7 +2967,7 @@ declare_lint! {
Warn,
"detects derive helper attributes that are used before they are introduced",
@future_incompatible = FutureIncompatibleInfo {
reason: FutureIncompatibilityReason::FutureReleaseErrorDontReportInDeps,
reason: FutureIncompatibilityReason::FutureReleaseError,
reference: "issue #79202 <https://github.com/rust-lang/rust/issues/79202>",
};
}
Expand Down Expand Up @@ -3126,7 +3134,7 @@ declare_lint! {
Warn,
"transparent type contains an external ZST that is marked #[non_exhaustive] or contains private fields",
@future_incompatible = FutureIncompatibleInfo {
reason: FutureIncompatibilityReason::FutureReleaseErrorDontReportInDeps,
reason: FutureIncompatibilityReason::FutureReleaseError,
reference: "issue #78586 <https://github.com/rust-lang/rust/issues/78586>",
};
}
Expand Down Expand Up @@ -3177,7 +3185,7 @@ declare_lint! {
Warn,
"unstable syntax can change at any point in the future, causing a hard error!",
@future_incompatible = FutureIncompatibleInfo {
reason: FutureIncompatibilityReason::FutureReleaseErrorDontReportInDeps,
reason: FutureIncompatibilityReason::FutureReleaseError,
reference: "issue #65860 <https://github.com/rust-lang/rust/issues/65860>",
};
}
Expand Down Expand Up @@ -3685,8 +3693,9 @@ declare_lint! {
Warn,
"use of unsupported calling convention for function pointer",
@future_incompatible = FutureIncompatibleInfo {
reason: FutureIncompatibilityReason::FutureReleaseErrorReportInDeps,
reason: FutureIncompatibilityReason::FutureReleaseError,
reference: "issue #130260 <https://github.com/rust-lang/rust/issues/130260>",
report_in_deps: true,
};
}

Expand Down Expand Up @@ -4368,7 +4377,7 @@ declare_lint! {
Warn,
"detects certain glob imports that require reporting an ambiguity error",
@future_incompatible = FutureIncompatibleInfo {
reason: FutureIncompatibilityReason::FutureReleaseErrorDontReportInDeps,
reason: FutureIncompatibilityReason::FutureReleaseError,
reference: "issue #114095 <https://github.com/rust-lang/rust/issues/114095>",
};
}
Expand Down Expand Up @@ -4523,7 +4532,7 @@ declare_lint! {
Deny,
"elided lifetimes cannot be used in associated constants in impls",
@future_incompatible = FutureIncompatibleInfo {
reason: FutureIncompatibilityReason::FutureReleaseErrorDontReportInDeps,
reason: FutureIncompatibilityReason::FutureReleaseError,
reference: "issue #115010 <https://github.com/rust-lang/rust/issues/115010>",
};
}
Expand Down Expand Up @@ -4570,7 +4579,7 @@ declare_lint! {
Warn,
"detects certain macro bindings that should not be re-exported",
@future_incompatible = FutureIncompatibleInfo {
reason: FutureIncompatibilityReason::FutureReleaseErrorDontReportInDeps,
reason: FutureIncompatibilityReason::FutureReleaseError,
reference: "issue #120192 <https://github.com/rust-lang/rust/issues/120192>",
};
}
Expand Down Expand Up @@ -4635,7 +4644,7 @@ declare_lint! {
Warn,
"impl contains type parameters that are not covered",
@future_incompatible = FutureIncompatibleInfo {
reason: FutureIncompatibilityReason::FutureReleaseErrorDontReportInDeps,
reason: FutureIncompatibilityReason::FutureReleaseError,
reference: "issue #124559 <https://github.com/rust-lang/rust/issues/124559>",
};
}
Expand Down Expand Up @@ -4799,7 +4808,7 @@ declare_lint! {
Warn,
"detects out of scope calls to `macro_rules` in key-value attributes",
@future_incompatible = FutureIncompatibleInfo {
reason: FutureIncompatibilityReason::FutureReleaseErrorDontReportInDeps,
reason: FutureIncompatibilityReason::FutureReleaseError,
reference: "issue #124535 <https://github.com/rust-lang/rust/issues/124535>",
};
}
Expand Down Expand Up @@ -5040,8 +5049,9 @@ declare_lint! {
Warn,
"detects code relying on rustc's non-spec-compliant wasm C ABI",
@future_incompatible = FutureIncompatibleInfo {
reason: FutureIncompatibilityReason::FutureReleaseErrorReportInDeps,
reason: FutureIncompatibilityReason::FutureReleaseError,
reference: "issue #138762 <https://github.com/rust-lang/rust/issues/138762>",
report_in_deps: true,
};
}

Expand Down Expand Up @@ -5081,7 +5091,8 @@ declare_lint! {
Warn,
"detects code that could be affected by ABI issues on aarch64 softfloat targets",
@future_incompatible = FutureIncompatibleInfo {
reason: FutureIncompatibilityReason::FutureReleaseErrorReportInDeps,
reason: FutureIncompatibilityReason::FutureReleaseError,
reference: "issue #134375 <https://github.com/rust-lang/rust/issues/134375>",
report_in_deps: true,
};
}
Loading
Loading