privacy: Print effective visibilities of constructors
This commit is contained in:
parent
24093fc6bd
commit
bb401bd04d
3 changed files with 38 additions and 16 deletions
|
@ -959,6 +959,10 @@ impl<'tcx, 'a> Visitor<'tcx> for TestReachabilityVisitor<'tcx, 'a> {
|
|||
for variant in def.variants.iter() {
|
||||
let variant_id = self.tcx.hir().local_def_id(variant.id);
|
||||
self.effective_visibility_diagnostic(variant_id);
|
||||
if let Some(ctor_hir_id) = variant.data.ctor_hir_id() {
|
||||
let ctor_def_id = self.tcx.hir().local_def_id(ctor_hir_id);
|
||||
self.effective_visibility_diagnostic(ctor_def_id);
|
||||
}
|
||||
for field in variant.data.fields() {
|
||||
let def_id = self.tcx.hir().local_def_id(field.hir_id);
|
||||
self.effective_visibility_diagnostic(def_id);
|
||||
|
@ -966,6 +970,10 @@ impl<'tcx, 'a> Visitor<'tcx> for TestReachabilityVisitor<'tcx, 'a> {
|
|||
}
|
||||
}
|
||||
hir::ItemKind::Struct(ref def, _) | hir::ItemKind::Union(ref def, _) => {
|
||||
if let Some(ctor_hir_id) = def.ctor_hir_id() {
|
||||
let ctor_def_id = self.tcx.hir().local_def_id(ctor_hir_id);
|
||||
self.effective_visibility_diagnostic(ctor_def_id);
|
||||
}
|
||||
for field in def.fields() {
|
||||
let def_id = self.tcx.hir().local_def_id(field.hir_id);
|
||||
self.effective_visibility_diagnostic(def_id);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue