diff options
| author | Ralf Jung <post@ralfj.de> | 2024-08-31 15:06:39 +0200 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2024-08-31 15:11:48 +0200 |
| commit | 3cec2d693520b8a409a8ba6d2b6d1a40e14ade62 (patch) | |
| tree | 20b075da8afff73351c9f73fde03617209144edd | |
| parent | e3b1966137264ab6be7e42ce55b6bb6f5cea6413 (diff) | |
| download | rust-3cec2d693520b8a409a8ba6d2b6d1a40e14ade62.tar.gz rust-3cec2d693520b8a409a8ba6d2b6d1a40e14ade62.zip | |
don't take reachability into account when warning about missing-const-stability
| -rw-r--r-- | compiler/rustc_passes/src/stability.rs | 3 |
1 files changed, 1 insertions, 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 @@ impl<'tcx> MissingStabilityAnnotations<'tcx> { 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 }); } |
