]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_privacy/lib.rs
Remove random Idents outside of libsyntax
[rust.git] / src / librustc_privacy / lib.rs
index d077ee451fb801c798c8c218db0e537a938c0882..cf964107d16b38e201fb933e3d8418380efe356f 100644 (file)
@@ -392,7 +392,6 @@ enum PrivacyResult {
 
 enum FieldName {
     UnnamedField(usize), // index
-    // (Name, not Ident, because struct fields are not macro-hygienic)
     NamedField(ast::Name),
 }
 
@@ -847,12 +846,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(_) => {}
         }
     }
 }
@@ -941,7 +936,7 @@ fn visit_pat(&mut self, pattern: &hir::Pat) {
                 let variant = adt.variant_of_def(def);
                 for field in fields {
                     self.check_field(pattern.span, adt, variant,
-                                     NamedField(field.node.ident.name));
+                                     NamedField(field.node.name));
                 }
             }
 
@@ -988,7 +983,7 @@ fn visit_path(&mut self, path: &hir::Path, id: ast::NodeId) {
 
     fn visit_path_list_item(&mut self, prefix: &hir::Path, item: &hir::PathListItem) {
         let name = if let hir::PathListIdent { name, .. } = item.node {
-            name.name
+            name
         } else if !prefix.segments.is_empty() {
             prefix.segments.last().unwrap().identifier.name
         } else {