Skip to content

Commit

Permalink
Remove unnecessary pubs
Browse files Browse the repository at this point in the history
  • Loading branch information
jseyfried committed Mar 26, 2016
1 parent 227cc5c commit 60a836f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 24 deletions.
32 changes: 14 additions & 18 deletions src/librustc_resolve/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -119,12 +119,12 @@ enum SuggestionType {
}

/// Candidates for a name resolution failure
pub struct SuggestedCandidates {
struct SuggestedCandidates {
name: String,
candidates: Vec<Path>,
}

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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -1131,7 +1131,7 @@ pub struct Resolver<'a, 'tcx: 'a> {
arenas: &'a ResolverArenas<'a>,
}

pub struct ResolverArenas<'a> {
struct ResolverArenas<'a> {
modules: arena::TypedArena<ModuleS<'a>>,
name_bindings: arena::TypedArena<NameBinding<'a>>,
import_directives: arena::TypedArena<ImportDirective>,
Expand Down Expand Up @@ -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<PathResolution> {
fn resolve_path(&mut self, id: NodeId, path: &Path, path_depth: usize, namespace: Namespace)
-> Option<PathResolution> {
let span = path.span;
let segments = &path.segments[..path.segments.len() - path_depth];

Expand Down Expand Up @@ -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<Box<Fn(hir_map::Node, &mut bool) -> 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<Box<Fn(hir_map::Node, &mut bool) -> bool>>)
-> Resolver<'a, 'tcx> {
let mut resolver = Resolver::new(session, ast_map, make_glob_map, arenas);

resolver.callback = callback;
Expand Down
12 changes: 6 additions & 6 deletions src/librustc_resolve/resolve_imports.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,12 @@ impl ImportDirectiveSubclass {
/// One import directive.
#[derive(Debug,Clone)]
pub struct ImportDirective {
pub module_path: Vec<Name>,
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<Name>,
subclass: ImportDirectiveSubclass,
span: Span,
id: NodeId,
is_public: bool, // see note in ImportResolutionPerNamespace about how to use this
is_prelude: bool,
}

impl ImportDirective {
Expand Down

0 comments on commit 60a836f

Please sign in to comment.