use crate::ty::{self, TyCtxt};
use crate::util::nodemap::{FxHashSet, FxHashMap};
-use std::mem::replace;
use std::cmp::Ordering;
+use std::mem::replace;
+use std::num::NonZeroU32;
+
+use rustc_error_codes::*;
+
#[derive(PartialEq, Clone, Copy, Debug)]
pub enum StabilityLevel {
let stability = tcx.intern_stability(Stability {
level: attr::StabilityLevel::Unstable {
reason: Some(Symbol::intern(reason)),
- issue: 27812,
+ issue: NonZeroU32::new(27812),
is_soft: false,
},
feature: sym::rustc_private,
sess: &Session,
feature: Symbol,
reason: Option<Symbol>,
- issue: u32,
+ issue: Option<NonZeroU32>,
is_soft: bool,
span: Span,
soft_handler: impl FnOnce(&'static lint::Lint, Span, &str),
soft_handler(lint::builtin::SOFT_UNSTABLE, span, &msg)
} else {
emit_feature_err(
- &sess.parse_sess, feature, span, GateIssue::Library(Some(issue)), &msg
+ &sess.parse_sess, feature, span, GateIssue::Library(issue), &msg
);
}
}
}
pub fn early_report_deprecation(
- sess: &Session,
+ lint_buffer: &'a mut lint::LintBuffer,
message: &str,
suggestion: Option<Symbol>,
lint: &'static Lint,
}
let diag = BuiltinLintDiagnostics::DeprecatedMacro(suggestion, span);
- sess.buffer_lint_with_diagnostic(lint, CRATE_NODE_ID, span, message, diag);
+ lint_buffer.buffer_lint_with_diagnostic(lint, CRATE_NODE_ID, span, message, diag);
}
fn late_report_deprecation(
Deny {
feature: Symbol,
reason: Option<Symbol>,
- issue: u32,
+ issue: Option<NonZeroU32>,
is_soft: bool,
},
/// The item does not have the `#[stable]` or `#[unstable]` marker assigned.
// the `-Z force-unstable-if-unmarked` flag present (we're
// compiling a compiler crate), then let this missing feature
// annotation slide.
- if feature == sym::rustc_private && issue == 27812 {
+ if feature == sym::rustc_private && issue == NonZeroU32::new(27812) {
if self.sess.opts.debugging_opts.force_unstable_if_unmarked {
return EvalResult::Allow;
}