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<'_> {
149149 subst : & Substitution ,
150150 is_enum : bool ,
151151 ) -> 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 )
157155 } 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
163157 }
164158 }
165159}
You can’t perform that action at this time.
0 commit comments