about summary refs log tree commit diff
path: root/compiler/rustc_errors/src
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/rustc_errors/src')
-rw-r--r--compiler/rustc_errors/src/diagnostic.rs37
-rw-r--r--compiler/rustc_errors/src/lib.rs2
2 files changed, 1 insertions, 38 deletions
diff --git a/compiler/rustc_errors/src/diagnostic.rs b/compiler/rustc_errors/src/diagnostic.rs
index 632f819e584..9ed8ab67431 100644
--- a/compiler/rustc_errors/src/diagnostic.rs
+++ b/compiler/rustc_errors/src/diagnostic.rs
@@ -7,7 +7,6 @@ use rustc_data_structures::fx::FxHashMap;
 use rustc_error_messages::fluent_value_from_str_list_sep_by_and;
 use rustc_error_messages::FluentValue;
 use rustc_lint_defs::{Applicability, LintExpectationId};
-use rustc_span::edition::LATEST_STABLE_EDITION;
 use rustc_span::symbol::Symbol;
 use rustc_span::{Span, DUMMY_SP};
 use std::borrow::Cow;
@@ -1071,39 +1070,3 @@ impl PartialEq for Diagnostic {
         self.keys() == other.keys()
     }
 }
-
-pub enum HelpUseLatestEdition {
-    Cargo,
-    Standalone,
-}
-
-impl HelpUseLatestEdition {
-    pub fn new() -> Self {
-        if std::env::var_os("CARGO").is_some() { Self::Cargo } else { Self::Standalone }
-    }
-}
-
-impl AddToDiagnostic for HelpUseLatestEdition {
-    fn add_to_diagnostic_with<F>(self, diag: &mut Diagnostic, f: F)
-    where
-        F: Fn(&mut Diagnostic, SubdiagnosticMessage) -> SubdiagnosticMessage,
-    {
-        let msg = f(
-            diag,
-            match self {
-                Self::Cargo => {
-                    format!("set `edition = \"{}\"` in `Cargo.toml`", LATEST_STABLE_EDITION)
-                }
-                Self::Standalone => {
-                    format!("pass `--edition {}` to `rustc`", LATEST_STABLE_EDITION)
-                }
-            }
-            .into(),
-        );
-        diag.help(msg);
-
-        let msg =
-            f(diag, "for more on editions, read https://doc.rust-lang.org/edition-guide".into());
-        diag.note(msg);
-    }
-}
diff --git a/compiler/rustc_errors/src/lib.rs b/compiler/rustc_errors/src/lib.rs
index 05cfebbfe8a..ec04e865d53 100644
--- a/compiler/rustc_errors/src/lib.rs
+++ b/compiler/rustc_errors/src/lib.rs
@@ -378,7 +378,7 @@ pub struct DelayedBugPanic;
 
 pub use diagnostic::{
     AddToDiagnostic, DecorateLint, Diagnostic, DiagnosticArg, DiagnosticArgValue, DiagnosticId,
-    DiagnosticStyledString, HelpUseLatestEdition, IntoDiagnosticArg, SubDiagnostic,
+    DiagnosticStyledString, IntoDiagnosticArg, SubDiagnostic,
 };
 pub use diagnostic_builder::{DiagnosticBuilder, EmissionGuarantee, Noted};
 pub use diagnostic_impls::{DiagnosticArgFromDisplay, DiagnosticSymbolList};