Skip to content

Commit 3cec2d6

Browse files
committed
don't take reachability into account when warning about missing-const-stability
1 parent e3b1966 commit 3cec2d6

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

compiler/rustc_passes/src/stability.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -544,9 +544,8 @@ impl<'tcx> MissingStabilityAnnotations<'tcx> {
544544
let is_stable =
545545
self.tcx.lookup_stability(def_id).is_some_and(|stability| stability.level.is_stable());
546546
let missing_const_stability_attribute = self.tcx.lookup_const_stability(def_id).is_none();
547-
let is_reachable = self.effective_visibilities.is_reachable(def_id);
548547

549-
if is_const && is_stable && missing_const_stability_attribute && is_reachable {
548+
if is_const && is_stable && missing_const_stability_attribute {
550549
let descr = self.tcx.def_descr(def_id.to_def_id());
551550
self.tcx.dcx().emit_err(errors::MissingConstStabAttr { span, descr });
552551
}

0 commit comments

Comments
 (0)