enum FieldName {
UnnamedField(usize), // index
- // (Name, not Ident, because struct fields are not macro-hygienic)
NamedField(ast::Name),
}
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(_) => {}
}
}
}
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 {