Skip to content

Commit

Permalink
Address comments, and refer to the issue the same way existing code does
Browse files Browse the repository at this point in the history
  • Loading branch information
semicoleon committed Jun 4, 2022
1 parent 9ee234e commit d536c18
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions compiler/rustc_passes/src/stability.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//! A pass that annotates every item and method with its stability level,
//! propagating default levels lexically from parent to children ast nodes.
use hir::ItemKind;
use rustc_attr::{self as attr, ConstStability, Stability};
use rustc_data_structures::fx::{FxHashSet, FxIndexMap};
use rustc_errors::struct_span_err;
Expand All @@ -10,7 +9,7 @@ use rustc_hir::def::{DefKind, Res};
use rustc_hir::def_id::{LocalDefId, CRATE_DEF_ID};
use rustc_hir::hir_id::CRATE_HIR_ID;
use rustc_hir::intravisit::{self, Visitor};
use rustc_hir::{FieldDef, Generics, HirId, Item, TraitRef, Ty, TyKind, Variant};
use rustc_hir::{FieldDef, Generics, HirId, Item, ItemKind, TraitRef, Ty, TyKind, Variant};
use rustc_middle::hir::nested_filter;
use rustc_middle::middle::privacy::AccessLevels;
use rustc_middle::middle::stability::{AllowUnstable, DeprecationEntry, Index};
Expand Down Expand Up @@ -825,6 +824,8 @@ impl<'tcx> Visitor<'tcx> for Checker<'tcx> {
}

/// Check whether a path is a `use` item that has been marked as unstable.
///
/// See issue #94972 for details on why this is a special case
fn is_unstable_reexport<'tcx>(tcx: TyCtxt<'tcx>, id: hir::HirId) -> bool {
// Get the LocalDefId so we can lookup the item to check the kind.
let Some(def_id) = tcx.hir().opt_local_def_id(id) else { return false};
Expand Down
3 changes: 2 additions & 1 deletion src/test/ui/stability-attribute/allow-unstable-reexport.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Allow an unstable re-export without requiring a feature gate. https://github.com/rust-lang/rust/issues/94972
// Allow an unstable re-export without requiring a feature gate.
// #94972

// aux-build:lint-stability.rs
// aux-build:lint-stability-reexport.rs
Expand Down

0 comments on commit d536c18

Please sign in to comment.