use rustc_data_structures::fx::FxHashMap;
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
-use rustc_errors::{
- Diagnostic, DiagnosticBuilder, DiagnosticId, EmissionGuarantee, ErrorGuaranteed, MultiSpan,
-};
+use rustc_errors::{Diagnostic, DiagnosticId, LintDiagnosticBuilder, MultiSpan};
use rustc_hir::HirId;
use rustc_index::vec::IndexVec;
use rustc_query_system::ich::StableHashingContext;
}
}
-pub struct LintDiagnosticBuilder<'a, G: EmissionGuarantee>(DiagnosticBuilder<'a, G>);
-
-impl<'a, G: EmissionGuarantee> LintDiagnosticBuilder<'a, G> {
- /// Return the inner `DiagnosticBuilder`, first setting the primary message to `msg`.
- pub fn build(mut self, msg: &str) -> DiagnosticBuilder<'a, G> {
- self.0.set_primary_message(msg);
- self.0.set_is_lint();
- self.0
- }
-
- /// Create a `LintDiagnosticBuilder` from some existing `DiagnosticBuilder`.
- pub fn new(err: DiagnosticBuilder<'a, G>) -> LintDiagnosticBuilder<'a, G> {
- LintDiagnosticBuilder(err)
- }
-}
-
-impl<'a> LintDiagnosticBuilder<'a, ErrorGuaranteed> {
- pub fn forget_guarantee(self) -> LintDiagnosticBuilder<'a, ()> {
- LintDiagnosticBuilder(self.0.forget_guarantee())
- }
-}
-
pub fn explain_lint_level_source(
lint: &'static Lint,
level: Level,
let has_future_breakage = future_incompatible.map_or(
// Default allow lints trigger too often for testing.
- sess.opts.debugging_opts.future_incompat_test && lint.default_level != Level::Allow,
+ sess.opts.unstable_opts.future_incompat_test && lint.default_level != Level::Allow,
|incompat| {
matches!(incompat.reason, FutureIncompatibilityReason::FutureReleaseErrorReportNow)
},