@@ -22,8 +22,9 @@ use syntax::attr::{self, Stability, Deprecation, RustcDeprecation};
22
22
use crate :: ty:: { self , TyCtxt } ;
23
23
use crate :: util:: nodemap:: { FxHashSet , FxHashMap } ;
24
24
25
- use std:: mem:: replace;
26
25
use std:: cmp:: Ordering ;
26
+ use std:: mem:: replace;
27
+ use std:: num:: NonZeroU32 ;
27
28
28
29
#[ derive( PartialEq , Clone , Copy , Debug ) ]
29
30
pub enum StabilityLevel {
@@ -441,7 +442,7 @@ impl<'tcx> Index<'tcx> {
441
442
let stability = tcx. intern_stability ( Stability {
442
443
level : attr:: StabilityLevel :: Unstable {
443
444
reason : Some ( Symbol :: intern ( reason) ) ,
444
- issue : 27812 ,
445
+ issue : NonZeroU32 :: new ( 27812 ) ,
445
446
is_soft : false ,
446
447
} ,
447
448
feature : sym:: rustc_private,
@@ -488,7 +489,7 @@ pub fn report_unstable(
488
489
sess : & Session ,
489
490
feature : Symbol ,
490
491
reason : Option < Symbol > ,
491
- issue : u32 ,
492
+ issue : Option < NonZeroU32 > ,
492
493
is_soft : bool ,
493
494
span : Span ,
494
495
soft_handler : impl FnOnce ( & ' static lint:: Lint , Span , & str ) ,
@@ -520,7 +521,7 @@ pub fn report_unstable(
520
521
soft_handler ( lint:: builtin:: SOFT_UNSTABLE , span, & msg)
521
522
} else {
522
523
emit_feature_err (
523
- & sess. parse_sess , feature, span, GateIssue :: Library ( Some ( issue) ) , & msg
524
+ & sess. parse_sess , feature, span, GateIssue :: Library ( issue) , & msg
524
525
) ;
525
526
}
526
527
}
@@ -637,7 +638,7 @@ pub enum EvalResult {
637
638
Deny {
638
639
feature : Symbol ,
639
640
reason : Option < Symbol > ,
640
- issue : u32 ,
641
+ issue : Option < NonZeroU32 > ,
641
642
is_soft : bool ,
642
643
} ,
643
644
/// The item does not have the `#[stable]` or `#[unstable]` marker assigned.
@@ -758,7 +759,7 @@ impl<'tcx> TyCtxt<'tcx> {
758
759
// the `-Z force-unstable-if-unmarked` flag present (we're
759
760
// compiling a compiler crate), then let this missing feature
760
761
// annotation slide.
761
- if feature == sym:: rustc_private && issue == 27812 {
762
+ if feature == sym:: rustc_private && issue == NonZeroU32 :: new ( 27812 ) {
762
763
if self . sess . opts . debugging_opts . force_unstable_if_unmarked {
763
764
return EvalResult :: Allow ;
764
765
}
0 commit comments