diff options
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/rustc_lint/src/array_into_iter.rs | 1 | ||||
| -rw-r--r-- | compiler/rustc_lint_defs/src/lib.rs | 11 | ||||
| -rw-r--r-- | compiler/rustc_middle/src/lint.rs | 2 |
3 files changed, 5 insertions, 9 deletions
diff --git a/compiler/rustc_lint/src/array_into_iter.rs b/compiler/rustc_lint/src/array_into_iter.rs index dc6ba8ebac5..14ffbbc35eb 100644 --- a/compiler/rustc_lint/src/array_into_iter.rs +++ b/compiler/rustc_lint/src/array_into_iter.rs @@ -39,7 +39,6 @@ declare_lint! { @future_incompatible = FutureIncompatibleInfo { reference: "issue #66145 <https://github.com/rust-lang/rust/issues/66145>", reason: FutureIncompatibilityReason::EditionSemanticsChange(Edition::Edition2021), - custom_explanation: Some("This will continue to compile in Rust 2021 but it will behave slightly differently!") }; } diff --git a/compiler/rustc_lint_defs/src/lib.rs b/compiler/rustc_lint_defs/src/lib.rs index 185284039e9..b3d98747dcf 100644 --- a/compiler/rustc_lint_defs/src/lib.rs +++ b/compiler/rustc_lint_defs/src/lib.rs @@ -149,16 +149,14 @@ pub struct FutureIncompatibleInfo { /// be emitted in JSON messages to be displayed by Cargo /// for upstream deps pub future_breakage: Option<FutureBreakage>, - /// Provide a custom explanation message for diagnostics - /// if the default explanation message is not appropriate - pub custom_explanation: Option<&'static str>, } /// The reason for future incompatibility #[derive(Copy, Clone, Debug)] pub enum FutureIncompatibilityReason { - /// We're fixing a bug which will impact all editions - BugFix, + /// This will be an error in a future release + /// for all editions + FutureReleaseError, /// Previously accepted code that will become an /// error in the provided edition EditionError(Edition), @@ -186,9 +184,8 @@ impl FutureIncompatibleInfo { pub const fn default_fields_for_macro() -> Self { FutureIncompatibleInfo { reference: "", - reason: FutureIncompatibilityReason::BugFix, + reason: FutureIncompatibilityReason::FutureReleaseError, future_breakage: None, - custom_explanation: None, } } } diff --git a/compiler/rustc_middle/src/lint.rs b/compiler/rustc_middle/src/lint.rs index c0a92891f7b..8180d853f60 100644 --- a/compiler/rustc_middle/src/lint.rs +++ b/compiler/rustc_middle/src/lint.rs @@ -386,7 +386,7 @@ pub fn struct_lint_level<'s, 'd>( { let current_edition = sess.edition(); format!( - "this is valid in the current edition (Rust {}) but is not accepted in the Rust {} edition!", + "this is accepted in the current edition (Rust {}) but is a hard error in Rust {}!", current_edition, edition ) } else if let FutureIncompatibilityReason::EditionSemanticsChange(edition) = |
