give FutureIncompatibilityReason variants more explicit names

This commit is contained in:
Ralf Jung
2023-09-22 08:25:11 +02:00
parent b757318718
commit e888d470e9
4 changed files with 34 additions and 19 deletions

View File

@@ -347,12 +347,18 @@ pub struct FutureIncompatibleInfo {
/// The reason for future incompatibility
#[derive(Copy, Clone, Debug)]
pub enum FutureIncompatibilityReason {
/// This will be an error in a future release
/// for all editions
FutureReleaseError,
/// This will be an error in a future release for all editions
///
/// This will *not* show up in cargo's future breakage report.
/// The warning will hence only be seen in local crates, not in dependencies.
FutureReleaseErrorDontReportInDeps,
/// This will be an error in a future release, and
/// Cargo should create a report even for dependencies
FutureReleaseErrorReportNow,
///
/// This is the *only* reason that will make future incompatibility warnings show up in cargo's
/// reports. All other future incompatibility warnings are not visible when they occur in a
/// dependency.
FutureReleaseErrorReportInDeps,
/// Code that changes meaning in some way in a
/// future release.
FutureReleaseSemanticsChange,
@@ -380,7 +386,7 @@ impl FutureIncompatibleInfo {
pub const fn default_fields_for_macro() -> Self {
FutureIncompatibleInfo {
reference: "",
reason: FutureIncompatibilityReason::FutureReleaseError,
reason: FutureIncompatibilityReason::FutureReleaseErrorDontReportInDeps,
explain_reason: true,
}
}