From 60a836fc930d808e19b39ece8982e46912964aa1 Mon Sep 17 00:00:00 2001 From: Jeffrey Seyfried Date: Thu, 17 Mar 2016 01:05:29 +0000 Subject: [PATCH] Remove unnecessary `pub`s --- src/librustc_resolve/lib.rs | 32 +++++++++++-------------- src/librustc_resolve/resolve_imports.rs | 12 +++++----- 2 files changed, 20 insertions(+), 24 deletions(-) diff --git a/src/librustc_resolve/lib.rs b/src/librustc_resolve/lib.rs index eacea848d94..c5a65a658ba 100644 --- a/src/librustc_resolve/lib.rs +++ b/src/librustc_resolve/lib.rs @@ -95,7 +95,7 @@ use resolve_imports::{ImportDirective, NameResolution}; // NB: This module needs to be declared first so diagnostics are // registered before they are used. -pub mod diagnostics; +mod diagnostics; mod check_unused; mod build_reduced_graph; @@ -119,12 +119,12 @@ enum SuggestionType { } /// Candidates for a name resolution failure -pub struct SuggestedCandidates { +struct SuggestedCandidates { name: String, candidates: Vec, } -pub enum ResolutionError<'a> { +enum ResolutionError<'a> { /// error E0401: can't use type parameters from outer function TypeParametersFromOuterFunction, /// error E0402: cannot use an outer type parameter in this context @@ -201,7 +201,7 @@ pub enum ResolutionError<'a> { /// Context of where `ResolutionError::UnresolvedName` arose. #[derive(Clone, PartialEq, Eq, Debug)] -pub enum UnresolvedNameContext { +enum UnresolvedNameContext { /// `PathIsMod(id)` indicates that a given path, used in /// expression context, actually resolved to a module rather than /// a value. The `id` attached to the variant is the node id of @@ -1131,7 +1131,7 @@ pub struct Resolver<'a, 'tcx: 'a> { arenas: &'a ResolverArenas<'a>, } -pub struct ResolverArenas<'a> { +struct ResolverArenas<'a> { modules: arena::TypedArena>, name_bindings: arena::TypedArena>, import_directives: arena::TypedArena, @@ -2584,12 +2584,8 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> { /// Skips `path_depth` trailing segments, which is also reflected in the /// returned value. See `middle::def::PathResolution` for more info. - pub fn resolve_path(&mut self, - id: NodeId, - path: &Path, - path_depth: usize, - namespace: Namespace) - -> Option { + fn resolve_path(&mut self, id: NodeId, path: &Path, path_depth: usize, namespace: Namespace) + -> Option { let span = path.span; let segments = &path.segments[..path.segments.len() - path_depth]; @@ -3658,13 +3654,13 @@ pub fn resolve_crate<'a, 'tcx>(session: &'a Session, /// preserving the ribs + current module. This allows resolve_path /// calls to be made with the correct scope info. The node in the /// callback corresponds to the current node in the walk. -pub fn create_resolver<'a, 'tcx>(session: &'a Session, - ast_map: &'a hir_map::Map<'tcx>, - krate: &'a Crate, - make_glob_map: MakeGlobMap, - arenas: &'a ResolverArenas<'a>, - callback: Option bool>>) - -> Resolver<'a, 'tcx> { +fn create_resolver<'a, 'tcx>(session: &'a Session, + ast_map: &'a hir_map::Map<'tcx>, + krate: &'a Crate, + make_glob_map: MakeGlobMap, + arenas: &'a ResolverArenas<'a>, + callback: Option bool>>) + -> Resolver<'a, 'tcx> { let mut resolver = Resolver::new(session, ast_map, make_glob_map, arenas); resolver.callback = callback; diff --git a/src/librustc_resolve/resolve_imports.rs b/src/librustc_resolve/resolve_imports.rs index f958ca2a441..7c5d131dbc5 100644 --- a/src/librustc_resolve/resolve_imports.rs +++ b/src/librustc_resolve/resolve_imports.rs @@ -58,12 +58,12 @@ impl ImportDirectiveSubclass { /// One import directive. #[derive(Debug,Clone)] pub struct ImportDirective { - pub module_path: Vec, - pub subclass: ImportDirectiveSubclass, - pub span: Span, - pub id: NodeId, - pub is_public: bool, // see note in ImportResolutionPerNamespace about how to use this - pub is_prelude: bool, + module_path: Vec, + subclass: ImportDirectiveSubclass, + span: Span, + id: NodeId, + is_public: bool, // see note in ImportResolutionPerNamespace about how to use this + is_prelude: bool, } impl ImportDirective {