File tree Expand file tree Collapse file tree 1 file changed +4
-10
lines changed Expand file tree Collapse file tree 1 file changed +4
-10
lines changed Original file line number Diff line number Diff line change @@ -149,17 +149,11 @@ impl UninhabitedFrom<'_> {
149
149
subst : & Substitution ,
150
150
is_enum : bool ,
151
151
) -> ControlFlow < VisiblyUninhabited > {
152
- let target_mod = self . target_mod ;
153
- let mut data_uninhabitedness =
154
- || ty. clone ( ) . substitute ( Interner , subst) . visit_with ( self , DebruijnIndex :: INNERMOST ) ;
155
- if is_enum {
156
- data_uninhabitedness ( )
152
+ if is_enum || vis. is_visible_from ( self . db . upcast ( ) , self . target_mod ) {
153
+ let ty = ty. clone ( ) . substitute ( Interner , subst) ;
154
+ ty. visit_with ( self , DebruijnIndex :: INNERMOST )
157
155
} else {
158
- match vis {
159
- Visibility :: Module ( mod_id) if mod_id == target_mod => data_uninhabitedness ( ) ,
160
- Visibility :: Module ( _) => CONTINUE_OPAQUELY_INHABITED ,
161
- Visibility :: Public => data_uninhabitedness ( ) ,
162
- }
156
+ CONTINUE_OPAQUELY_INHABITED
163
157
}
164
158
}
165
159
}
You can’t perform that action at this time.
0 commit comments