File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
compiler/rustc_privacy/src Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -339,7 +339,15 @@ trait VisibilityLike: Sized {
339339 effective_visibilities : & EffectiveVisibilities ,
340340 ) -> Self {
341341 let mut find = FindMin { tcx, effective_visibilities, min : Self :: MAX } ;
342- find. visit ( tcx. type_of ( def_id) ) ;
342+ let mut ty = tcx. type_of ( def_id) ;
343+ let param_env = tcx. param_env ( def_id) ;
344+ // We need this normalization when we check the visibility of a projection so it is applied
345+ // to the item behind the projection and not to the projection itself.
346+ ty = match tcx. try_normalize_erasing_regions ( param_env, ty) {
347+ Ok ( new_ty) => new_ty,
348+ Err ( _) => ty,
349+ } ;
350+ find. visit ( ty) ;
343351 if let Some ( trait_ref) = tcx. impl_trait_ref ( def_id) {
344352 find. visit_trait ( trait_ref. subst_identity ( ) ) ;
345353 }
You can’t perform that action at this time.
0 commit comments