]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_privacy/lib.rs
Auto merge of #28504 - Eljay:fix-trait-privacy, r=nrc
[rust.git] / src / librustc_privacy / lib.rs
index fb43d75c347e3e6e787a2c8bfa3e763c652bab97..710341952a7e8e718e459752591e16e5748d96dd 100644 (file)
@@ -847,12 +847,8 @@ fn check_method(&mut self, span: Span, method_def_id: DefId,
             ty::ImplContainer(_) => {
                 self.check_static_method(span, method_def_id, name)
             }
-            // Trait methods are always all public. The only controlling factor
-            // is whether the trait itself is accessible or not.
-            ty::TraitContainer(trait_def_id) => {
-                self.report_error(self.ensure_public(span, trait_def_id,
-                                                     None, "source trait"));
-            }
+            // Trait methods are always accessible if the trait is in scope.
+            ty::TraitContainer(_) => {}
         }
     }
 }