@@ -22,8 +22,9 @@ use syntax::attr::{self, Stability, Deprecation, RustcDeprecation};
2222use crate :: ty:: { self , TyCtxt } ;
2323use crate :: util:: nodemap:: { FxHashSet , FxHashMap } ;
2424
25- use std:: mem:: replace;
2625use std:: cmp:: Ordering ;
26+ use std:: mem:: replace;
27+ use std:: num:: NonZeroU32 ;
2728
2829#[ derive( PartialEq , Clone , Copy , Debug ) ]
2930pub enum StabilityLevel {
@@ -441,7 +442,7 @@ impl<'tcx> Index<'tcx> {
441442 let stability = tcx. intern_stability ( Stability {
442443 level : attr:: StabilityLevel :: Unstable {
443444 reason : Some ( Symbol :: intern ( reason) ) ,
444- issue : 27812 ,
445+ issue : NonZeroU32 :: new ( 27812 ) ,
445446 is_soft : false ,
446447 } ,
447448 feature : sym:: rustc_private,
@@ -488,7 +489,7 @@ pub fn report_unstable(
488489 sess : & Session ,
489490 feature : Symbol ,
490491 reason : Option < Symbol > ,
491- issue : u32 ,
492+ issue : Option < NonZeroU32 > ,
492493 is_soft : bool ,
493494 span : Span ,
494495 soft_handler : impl FnOnce ( & ' static lint:: Lint , Span , & str ) ,
@@ -520,7 +521,7 @@ pub fn report_unstable(
520521 soft_handler ( lint:: builtin:: SOFT_UNSTABLE , span, & msg)
521522 } else {
522523 emit_feature_err (
523- & sess. parse_sess , feature, span, GateIssue :: Library ( Some ( issue) ) , & msg
524+ & sess. parse_sess , feature, span, GateIssue :: Library ( issue) , & msg
524525 ) ;
525526 }
526527 }
@@ -637,7 +638,7 @@ pub enum EvalResult {
637638 Deny {
638639 feature : Symbol ,
639640 reason : Option < Symbol > ,
640- issue : u32 ,
641+ issue : Option < NonZeroU32 > ,
641642 is_soft : bool ,
642643 } ,
643644 /// The item does not have the `#[stable]` or `#[unstable]` marker assigned.
@@ -758,7 +759,7 @@ impl<'tcx> TyCtxt<'tcx> {
758759 // the `-Z force-unstable-if-unmarked` flag present (we're
759760 // compiling a compiler crate), then let this missing feature
760761 // annotation slide.
761- if feature == sym:: rustc_private && issue == 27812 {
762+ if feature == sym:: rustc_private && issue == NonZeroU32 :: new ( 27812 ) {
762763 if self . sess . opts . debugging_opts . force_unstable_if_unmarked {
763764 return EvalResult :: Allow ;
764765 }
0 commit comments