Skip to content

Error on private items with stability attributes #83397

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Try using lookup_stability instead
  • Loading branch information
camelid committed Jul 22, 2021
commit b318344c07eef8677e47e40858ef05932ddf29ba
2 changes: 1 addition & 1 deletion compiler/rustc_passes/src/stability.rs
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,7 @@ impl<'tcx> MissingStabilityAnnotations<'tcx> {
}

fn check_private_stability(&self, hir_id: HirId, span: Span) {
let stab = self.tcx.stability().local_stability(hir_id);
let stab = self.tcx.lookup_stability(self.tcx.hir().local_def_id(hir_id));
let is_error = stab.is_some() && !self.access_levels.is_reachable(hir_id);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note this is currently buggy: #64762

if is_error {
let def_id = self.tcx.hir().local_def_id(hir_id);
Expand Down