X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Flibrustc%2Fmiddle%2Fstability.rs;h=8f8b4ed98bd3b47b02166c2915310bdeadef5cbf;hb=798e389e578a0199f734c79424fa39e440910979;hp=93d0627ac6e401415c58d8a8e539c990121ea7dd;hpb=c296b2d8309100b27a89707b29f2583aa17e0d3e;p=rust.git diff --git a/src/librustc/middle/stability.rs b/src/librustc/middle/stability.rs index 93d0627ac6e..8f8b4ed98bd 100644 --- a/src/librustc/middle/stability.rs +++ b/src/librustc/middle/stability.rs @@ -22,8 +22,12 @@ 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 { @@ -441,7 +445,7 @@ pub fn new(tcx: TyCtxt<'tcx>) -> Index<'tcx> { 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, @@ -488,7 +492,7 @@ pub fn report_unstable( sess: &Session, feature: Symbol, reason: Option, - issue: u32, + issue: Option, is_soft: bool, span: Span, soft_handler: impl FnOnce(&'static lint::Lint, Span, &str), @@ -520,7 +524,7 @@ pub fn report_unstable( 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 ); } } @@ -637,7 +641,7 @@ pub enum EvalResult { Deny { feature: Symbol, reason: Option, - issue: u32, + issue: Option, is_soft: bool, }, /// The item does not have the `#[stable]` or `#[unstable]` marker assigned. @@ -758,7 +762,7 @@ pub fn eval_stability(self, def_id: DefId, id: Option, span: Span) -> Eva // 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; }