diff options
| author | Maybe Lapkin <waffle.lapkin@gmail.com> | 2024-11-14 02:46:47 +0100 |
|---|---|---|
| committer | Maybe Lapkin <waffle.lapkin@gmail.com> | 2024-11-14 06:01:14 +0100 |
| commit | 673bb5e3ffc4f2f58328aea87f3cf70c713cbaa7 (patch) | |
| tree | 659b249cd868d480fc205fba312812c59de84949 /compiler | |
| parent | 46967bd2e99b8387ccf066c8b9e6323d6dfaaefe (diff) | |
| download | rust-673bb5e3ffc4f2f58328aea87f3cf70c713cbaa7.tar.gz rust-673bb5e3ffc4f2f58328aea87f3cf70c713cbaa7.zip | |
Mark `never_type_fallback_flowing_into_unsafe` as a semantic change
...rather than a future error
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/rustc_lint_defs/src/builtin.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_lint_defs/src/lib.rs | 14 | ||||
| -rw-r--r-- | compiler/rustc_middle/src/lint.rs | 5 |
3 files changed, 19 insertions, 2 deletions
diff --git a/compiler/rustc_lint_defs/src/builtin.rs b/compiler/rustc_lint_defs/src/builtin.rs index 7f3f31843f5..efdb4b077e9 100644 --- a/compiler/rustc_lint_defs/src/builtin.rs +++ b/compiler/rustc_lint_defs/src/builtin.rs @@ -4185,7 +4185,7 @@ declare_lint! { Warn, "never type fallback affecting unsafe function calls", @future_incompatible = FutureIncompatibleInfo { - reason: FutureIncompatibilityReason::EditionAndFutureReleaseError(Edition::Edition2024), + reason: FutureIncompatibilityReason::EditionAndFutureReleaseSemanticsChange(Edition::Edition2024), reference: "issue #123748 <https://github.com/rust-lang/rust/issues/123748>", }; @edition Edition2024 => Deny; diff --git a/compiler/rustc_lint_defs/src/lib.rs b/compiler/rustc_lint_defs/src/lib.rs index 1bf5d9e5098..eac4afee050 100644 --- a/compiler/rustc_lint_defs/src/lib.rs +++ b/compiler/rustc_lint_defs/src/lib.rs @@ -432,6 +432,17 @@ pub enum FutureIncompatibilityReason { /// [`EditionError`]: FutureIncompatibilityReason::EditionError /// [`FutureReleaseErrorDontReportInDeps`]: FutureIncompatibilityReason::FutureReleaseErrorDontReportInDeps EditionAndFutureReleaseError(Edition), + /// This will change meaning in the provided edition *and* in a future + /// release. + /// + /// This variant a combination of [`FutureReleaseSemanticsChange`] + /// and [`EditionSemanticsChange`]. This is useful in rare cases when we + /// want to have "preview" of a breaking change in an edition, but do a + /// breaking change later on all editions anyway. + /// + /// [`EditionSemanticsChange`]: FutureIncompatibilityReason::EditionSemanticsChange + /// [`FutureReleaseSemanticsChange`]: FutureIncompatibilityReason::FutureReleaseSemanticsChange + EditionAndFutureReleaseSemanticsChange(Edition), /// A custom reason. /// /// Choose this variant if the built-in text of the diagnostic of the @@ -446,7 +457,8 @@ impl FutureIncompatibilityReason { match self { Self::EditionError(e) | Self::EditionSemanticsChange(e) - | Self::EditionAndFutureReleaseError(e) => Some(e), + | Self::EditionAndFutureReleaseError(e) + | Self::EditionAndFutureReleaseSemanticsChange(e) => Some(e), FutureIncompatibilityReason::FutureReleaseErrorDontReportInDeps | FutureIncompatibilityReason::FutureReleaseErrorReportInDeps diff --git a/compiler/rustc_middle/src/lint.rs b/compiler/rustc_middle/src/lint.rs index 1bcdbe33286..92ba6ceee93 100644 --- a/compiler/rustc_middle/src/lint.rs +++ b/compiler/rustc_middle/src/lint.rs @@ -388,6 +388,11 @@ pub fn lint_level( it will become a hard error in Rust {edition} and in a future release in all editions!" ) } + FutureIncompatibilityReason::EditionAndFutureReleaseSemanticsChange(edition) => { + format!( + "this changes meaning in Rust {edition} and in a future release in all editions!" + ) + } FutureIncompatibilityReason::Custom(reason) => reason.to_owned(), }; |
