Remove unnecessary pub
s
This commit is contained in:
parent
227cc5cd26
commit
60a836fc93
2 changed files with 20 additions and 24 deletions
|
@ -95,7 +95,7 @@ use resolve_imports::{ImportDirective, NameResolution};
|
||||||
|
|
||||||
// NB: This module needs to be declared first so diagnostics are
|
// NB: This module needs to be declared first so diagnostics are
|
||||||
// registered before they are used.
|
// registered before they are used.
|
||||||
pub mod diagnostics;
|
mod diagnostics;
|
||||||
|
|
||||||
mod check_unused;
|
mod check_unused;
|
||||||
mod build_reduced_graph;
|
mod build_reduced_graph;
|
||||||
|
@ -119,12 +119,12 @@ enum SuggestionType {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Candidates for a name resolution failure
|
/// Candidates for a name resolution failure
|
||||||
pub struct SuggestedCandidates {
|
struct SuggestedCandidates {
|
||||||
name: String,
|
name: String,
|
||||||
candidates: Vec<Path>,
|
candidates: Vec<Path>,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub enum ResolutionError<'a> {
|
enum ResolutionError<'a> {
|
||||||
/// error E0401: can't use type parameters from outer function
|
/// error E0401: can't use type parameters from outer function
|
||||||
TypeParametersFromOuterFunction,
|
TypeParametersFromOuterFunction,
|
||||||
/// error E0402: cannot use an outer type parameter in this context
|
/// 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.
|
/// Context of where `ResolutionError::UnresolvedName` arose.
|
||||||
#[derive(Clone, PartialEq, Eq, Debug)]
|
#[derive(Clone, PartialEq, Eq, Debug)]
|
||||||
pub enum UnresolvedNameContext {
|
enum UnresolvedNameContext {
|
||||||
/// `PathIsMod(id)` indicates that a given path, used in
|
/// `PathIsMod(id)` indicates that a given path, used in
|
||||||
/// expression context, actually resolved to a module rather than
|
/// expression context, actually resolved to a module rather than
|
||||||
/// a value. The `id` attached to the variant is the node id of
|
/// 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>,
|
arenas: &'a ResolverArenas<'a>,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct ResolverArenas<'a> {
|
struct ResolverArenas<'a> {
|
||||||
modules: arena::TypedArena<ModuleS<'a>>,
|
modules: arena::TypedArena<ModuleS<'a>>,
|
||||||
name_bindings: arena::TypedArena<NameBinding<'a>>,
|
name_bindings: arena::TypedArena<NameBinding<'a>>,
|
||||||
import_directives: arena::TypedArena<ImportDirective>,
|
import_directives: arena::TypedArena<ImportDirective>,
|
||||||
|
@ -2584,12 +2584,8 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
|
||||||
|
|
||||||
/// Skips `path_depth` trailing segments, which is also reflected in the
|
/// Skips `path_depth` trailing segments, which is also reflected in the
|
||||||
/// returned value. See `middle::def::PathResolution` for more info.
|
/// returned value. See `middle::def::PathResolution` for more info.
|
||||||
pub fn resolve_path(&mut self,
|
fn resolve_path(&mut self, id: NodeId, path: &Path, path_depth: usize, namespace: Namespace)
|
||||||
id: NodeId,
|
-> Option<PathResolution> {
|
||||||
path: &Path,
|
|
||||||
path_depth: usize,
|
|
||||||
namespace: Namespace)
|
|
||||||
-> Option<PathResolution> {
|
|
||||||
let span = path.span;
|
let span = path.span;
|
||||||
let segments = &path.segments[..path.segments.len() - path_depth];
|
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
|
/// preserving the ribs + current module. This allows resolve_path
|
||||||
/// calls to be made with the correct scope info. The node in the
|
/// calls to be made with the correct scope info. The node in the
|
||||||
/// callback corresponds to the current node in the walk.
|
/// callback corresponds to the current node in the walk.
|
||||||
pub fn create_resolver<'a, 'tcx>(session: &'a Session,
|
fn create_resolver<'a, 'tcx>(session: &'a Session,
|
||||||
ast_map: &'a hir_map::Map<'tcx>,
|
ast_map: &'a hir_map::Map<'tcx>,
|
||||||
krate: &'a Crate,
|
krate: &'a Crate,
|
||||||
make_glob_map: MakeGlobMap,
|
make_glob_map: MakeGlobMap,
|
||||||
arenas: &'a ResolverArenas<'a>,
|
arenas: &'a ResolverArenas<'a>,
|
||||||
callback: Option<Box<Fn(hir_map::Node, &mut bool) -> bool>>)
|
callback: Option<Box<Fn(hir_map::Node, &mut bool) -> bool>>)
|
||||||
-> Resolver<'a, 'tcx> {
|
-> Resolver<'a, 'tcx> {
|
||||||
let mut resolver = Resolver::new(session, ast_map, make_glob_map, arenas);
|
let mut resolver = Resolver::new(session, ast_map, make_glob_map, arenas);
|
||||||
|
|
||||||
resolver.callback = callback;
|
resolver.callback = callback;
|
||||||
|
|
|
@ -58,12 +58,12 @@ impl ImportDirectiveSubclass {
|
||||||
/// One import directive.
|
/// One import directive.
|
||||||
#[derive(Debug,Clone)]
|
#[derive(Debug,Clone)]
|
||||||
pub struct ImportDirective {
|
pub struct ImportDirective {
|
||||||
pub module_path: Vec<Name>,
|
module_path: Vec<Name>,
|
||||||
pub subclass: ImportDirectiveSubclass,
|
subclass: ImportDirectiveSubclass,
|
||||||
pub span: Span,
|
span: Span,
|
||||||
pub id: NodeId,
|
id: NodeId,
|
||||||
pub is_public: bool, // see note in ImportResolutionPerNamespace about how to use this
|
is_public: bool, // see note in ImportResolutionPerNamespace about how to use this
|
||||||
pub is_prelude: bool,
|
is_prelude: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ImportDirective {
|
impl ImportDirective {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue