File tree 1 file changed +7
-4
lines changed
compiler/rustc_privacy/src
1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -2135,16 +2135,18 @@ impl<'tcx> PrivateItemsInPublicInterfacesChecker<'tcx, '_> {
2135
2135
// lints shouldn't be emmited even if `from` effective visibility
2136
2136
// is larger than `Priv` nominal visibility and if `Priv` can leak
2137
2137
// in some scenarios due to type inference.
2138
- let impl_ev = Some ( EffectiveVisibility :: of_impl :: < false > (
2138
+ let impl_ev = EffectiveVisibility :: of_impl :: < false > (
2139
2139
item. owner_id . def_id ,
2140
2140
tcx,
2141
2141
self . effective_visibilities ,
2142
- ) ) ;
2142
+ ) ;
2143
2143
2144
2144
// check that private components do not appear in the generics or predicates of inherent impls
2145
2145
// this check is intentionally NOT performed for impls of traits, per #90586
2146
2146
if impl_. of_trait . is_none ( ) {
2147
- self . check ( item. owner_id . def_id , impl_vis, impl_ev) . generics ( ) . predicates ( ) ;
2147
+ self . check ( item. owner_id . def_id , impl_vis, Some ( impl_ev) )
2148
+ . generics ( )
2149
+ . predicates ( ) ;
2148
2150
}
2149
2151
for impl_item_ref in impl_. items {
2150
2152
let impl_item_vis = if impl_. of_trait . is_none ( ) {
@@ -2159,8 +2161,9 @@ impl<'tcx> PrivateItemsInPublicInterfacesChecker<'tcx, '_> {
2159
2161
2160
2162
let impl_item_ev = if impl_. of_trait . is_none ( ) {
2161
2163
self . get ( impl_item_ref. id . owner_id . def_id )
2164
+ . map ( |ev| ev. min ( impl_ev, self . tcx ) )
2162
2165
} else {
2163
- impl_ev
2166
+ Some ( impl_ev)
2164
2167
} ;
2165
2168
2166
2169
self . check_assoc_item (
You can’t perform that action at this time.
0 commit comments