From 3cec2d693520b8a409a8ba6d2b6d1a40e14ade62 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sat, 31 Aug 2024 15:06:39 +0200 Subject: [PATCH] don't take reachability into account when warning about missing-const-stability --- compiler/rustc_passes/src/stability.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/compiler/rustc_passes/src/stability.rs b/compiler/rustc_passes/src/stability.rs index 4d58590ca3b..ba4c300ea61 100644 --- a/compiler/rustc_passes/src/stability.rs +++ b/compiler/rustc_passes/src/stability.rs @@ -544,9 +544,8 @@ fn check_missing_const_stability(&self, def_id: LocalDefId, span: Span) { let is_stable = self.tcx.lookup_stability(def_id).is_some_and(|stability| stability.level.is_stable()); let missing_const_stability_attribute = self.tcx.lookup_const_stability(def_id).is_none(); - let is_reachable = self.effective_visibilities.is_reachable(def_id); - if is_const && is_stable && missing_const_stability_attribute && is_reachable { + if is_const && is_stable && missing_const_stability_attribute { let descr = self.tcx.def_descr(def_id.to_def_id()); self.tcx.dcx().emit_err(errors::MissingConstStabAttr { span, descr }); }