Skip to content

Commit 60a836f

Browse files
committed
Remove unnecessary pubs
1 parent 227cc5c commit 60a836f

File tree

2 files changed

+20
-24
lines changed

2 files changed

+20
-24
lines changed

src/librustc_resolve/lib.rs

+14-18
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ use resolve_imports::{ImportDirective, NameResolution};
9595

9696
// NB: This module needs to be declared first so diagnostics are
9797
// registered before they are used.
98-
pub mod diagnostics;
98+
mod diagnostics;
9999

100100
mod check_unused;
101101
mod build_reduced_graph;
@@ -119,12 +119,12 @@ enum SuggestionType {
119119
}
120120

121121
/// Candidates for a name resolution failure
122-
pub struct SuggestedCandidates {
122+
struct SuggestedCandidates {
123123
name: String,
124124
candidates: Vec<Path>,
125125
}
126126

127-
pub enum ResolutionError<'a> {
127+
enum ResolutionError<'a> {
128128
/// error E0401: can't use type parameters from outer function
129129
TypeParametersFromOuterFunction,
130130
/// error E0402: cannot use an outer type parameter in this context
@@ -201,7 +201,7 @@ pub enum ResolutionError<'a> {
201201

202202
/// Context of where `ResolutionError::UnresolvedName` arose.
203203
#[derive(Clone, PartialEq, Eq, Debug)]
204-
pub enum UnresolvedNameContext {
204+
enum UnresolvedNameContext {
205205
/// `PathIsMod(id)` indicates that a given path, used in
206206
/// expression context, actually resolved to a module rather than
207207
/// a value. The `id` attached to the variant is the node id of
@@ -1131,7 +1131,7 @@ pub struct Resolver<'a, 'tcx: 'a> {
11311131
arenas: &'a ResolverArenas<'a>,
11321132
}
11331133

1134-
pub struct ResolverArenas<'a> {
1134+
struct ResolverArenas<'a> {
11351135
modules: arena::TypedArena<ModuleS<'a>>,
11361136
name_bindings: arena::TypedArena<NameBinding<'a>>,
11371137
import_directives: arena::TypedArena<ImportDirective>,
@@ -2584,12 +2584,8 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
25842584

25852585
/// Skips `path_depth` trailing segments, which is also reflected in the
25862586
/// returned value. See `middle::def::PathResolution` for more info.
2587-
pub fn resolve_path(&mut self,
2588-
id: NodeId,
2589-
path: &Path,
2590-
path_depth: usize,
2591-
namespace: Namespace)
2592-
-> Option<PathResolution> {
2587+
fn resolve_path(&mut self, id: NodeId, path: &Path, path_depth: usize, namespace: Namespace)
2588+
-> Option<PathResolution> {
25932589
let span = path.span;
25942590
let segments = &path.segments[..path.segments.len() - path_depth];
25952591

@@ -3658,13 +3654,13 @@ pub fn resolve_crate<'a, 'tcx>(session: &'a Session,
36583654
/// preserving the ribs + current module. This allows resolve_path
36593655
/// calls to be made with the correct scope info. The node in the
36603656
/// callback corresponds to the current node in the walk.
3661-
pub fn create_resolver<'a, 'tcx>(session: &'a Session,
3662-
ast_map: &'a hir_map::Map<'tcx>,
3663-
krate: &'a Crate,
3664-
make_glob_map: MakeGlobMap,
3665-
arenas: &'a ResolverArenas<'a>,
3666-
callback: Option<Box<Fn(hir_map::Node, &mut bool) -> bool>>)
3667-
-> Resolver<'a, 'tcx> {
3657+
fn create_resolver<'a, 'tcx>(session: &'a Session,
3658+
ast_map: &'a hir_map::Map<'tcx>,
3659+
krate: &'a Crate,
3660+
make_glob_map: MakeGlobMap,
3661+
arenas: &'a ResolverArenas<'a>,
3662+
callback: Option<Box<Fn(hir_map::Node, &mut bool) -> bool>>)
3663+
-> Resolver<'a, 'tcx> {
36683664
let mut resolver = Resolver::new(session, ast_map, make_glob_map, arenas);
36693665

36703666
resolver.callback = callback;

src/librustc_resolve/resolve_imports.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,12 @@ impl ImportDirectiveSubclass {
5858
/// One import directive.
5959
#[derive(Debug,Clone)]
6060
pub struct ImportDirective {
61-
pub module_path: Vec<Name>,
62-
pub subclass: ImportDirectiveSubclass,
63-
pub span: Span,
64-
pub id: NodeId,
65-
pub is_public: bool, // see note in ImportResolutionPerNamespace about how to use this
66-
pub is_prelude: bool,
61+
module_path: Vec<Name>,
62+
subclass: ImportDirectiveSubclass,
63+
span: Span,
64+
id: NodeId,
65+
is_public: bool, // see note in ImportResolutionPerNamespace about how to use this
66+
is_prelude: bool,
6767
}
6868

6969
impl ImportDirective {

0 commit comments

Comments
 (0)