fn resolve_ast_path(
        &mut self,
        path: &ast::Path,
        ns: Namespace,
        parent_scope: &ParentScope<'a>,
    ) -> Result<Res, (Span, ResolutionError<'a>)> {
        match self.resolve_path(
            &Segment::from_path(path),
            Some(ns),
            parent_scope,
            true,
            path.span,
            CrateLint::No,
        ) {
            PathResult::Module(ModuleOrUniformRoot::Module(module)) => Ok(module.res().unwrap()),
            PathResult::NonModule(path_res) if path_res.unresolved_segments() == 0 => {
                Ok(path_res.base_res())
            }
            PathResult::NonModule(..) => Err((
                path.span,
                ResolutionError::FailedToResolve {
                    label: String::from("type-relative paths are not supported in this context"),
                    suggestion: None,
                },
            )),
            PathResult::Module(..) | PathResult::Indeterminate => unreachable!(),
            PathResult::Failed { span, label, suggestion, .. } => {
                Err((span, ResolutionError::FailedToResolve { label, suggestion }))
            }
        }
    }
// Resolve a path passed from rustdoc or HIR lowering.
Resolve a path passed from rustdoc or HIR lowering.
Resolve a path passed from rustdoc or HIR lowering .
fn resolve_ast_path(
        &mut self,
        path: &ast::Path,
        ns: Namespace,
        parent_scope: &ParentScope<'a>,
    ) -> Result<Res, (Span, ResolutionError<'a>)> {
        match self.resolve_path(
            &Segment::from_path(path),
            Some(ns),
            parent_scope,
            true,
            path.span,
            CrateLint::No,
        ) {
            PathResult::Module(ModuleOrUniformRoot::Module(module)) => Ok(module.res().unwrap()),
            PathResult::NonModule(path_res) if path_res.unresolved_segments() == 0 => {
                Ok(path_res.base_res())
            }
            PathResult::NonModule(..) => Err((
                path.span,
                ResolutionError::FailedToResolve {
                    label: String::from("type-relative paths are not supported in this context"),
                    suggestion: None,
                },
            )),
            PathResult::Module(..) | PathResult::Indeterminate => unreachable!(),
            PathResult::Failed { span, label, suggestion, .. } => {
                Err((span, ResolutionError::FailedToResolve { label, suggestion }))
            }
        }
    }
fn resolve_ast_path ( & mut self , path : & ast :: Path , ns : Namespace , parent_scope : & ParentScope < ' a > , ) -> Result < Res , ( Span , ResolutionError < ' a > ) > { match self . resolve_path ( & Segment :: from_path ( path ) , Some ( ns ) , parent_scope , true , path . span , CrateLint :: No , ) { PathResult :: Module ( ModuleOrUniformRoot :: Module ( module ) ) => Ok ( module . res ( ) . unwrap ( ) ) , PathResult :: NonModule ( path_res ) if path_res . unresolved_segments ( ) == 0 => { Ok ( path_res . base_res ( ) ) } PathResult :: NonModule ( .. ) => Err ( ( path . span , ResolutionError :: FailedToResolve { label : String :: from ( " " ) , suggestion : None , } , ) ) , PathResult :: Module ( .. ) | PathResult :: Indeterminate => unreachable ! ( ) , PathResult :: Failed { span , label , suggestion , .. } => { Err ( ( span , ResolutionError :: FailedToResolve { label , suggestion } ) ) } } }
Resolve a path passed from rustdoc or HIR lowering.
Resolve a path passed from rustdoc or HIR lowering .
&mut self
path
&ast::Path
ns
Namespace
parent_scope
&ParentScope<'a>
&mut self
path
&ast::Path
ns
Namespace
parent_scope
&ParentScope<'a>