pub fn resolve_str_path_error(
        &mut self,
        span: Span,
        path_str: &str,
        ns: Namespace,
        module_id: LocalDefId,
    ) -> Result<(ast::Path, Res), ()> {
        let path = if path_str.starts_with("::") {
            ast::Path {
                span,
                segments: iter::once(Ident::with_dummy_span(kw::PathRoot))
                    .chain(path_str.split("::").skip(1).map(Ident::from_str))
                    .map(|i| self.new_ast_path_segment(i))
                    .collect(),
            }
        } else {
            ast::Path {
                span,
                segments: path_str
                    .split("::")
                    .map(Ident::from_str)
                    .map(|i| self.new_ast_path_segment(i))
                    .collect(),
            }
        };
        let module = self.module_map.get(&module_id).copied().unwrap_or(self.graph_root);
        let parent_scope = &ParentScope::module(module);
        let res = self.resolve_ast_path(&path, ns, parent_scope).map_err(|_| ())?;
        Ok((path, res))
    }
/// Rustdoc uses this to resolve things in a recoverable way. `ResolutionError<'a>`
/// isn't something that can be returned because it can't be made to live that long,
/// and also it's a private type. Fortunately rustdoc doesn't need to know the error,
/// just that an error occurred.
// FIXME(Manishearth): intra-doc links won't get warned of epoch changes.
Rustdoc uses this to resolve things in a recoverable way. `ResolutionError<'a>`
isn't something that can be returned because it can't be made to live that long,
and also it's a private type. Fortunately rustdoc doesn't need to know the error,
just that an error occurred.
FIXME(Manishearth): intra-doc links won't get warned of epoch changes.
Rustdoc uses this to resolve things in a recoverable way . ` ResolutionError< ' a > ` isn ' t something that can be returned because it can ' t be made to live that long and also it ' s a private type . Fortunately rustdoc doesn ' t need to know the error just that an error occurred . FIXME ( Manishearth ) : intra - doc links won ' t get warned of epoch changes .
pub fn resolve_str_path_error(
        &mut self,
        span: Span,
        path_str: &str,
        ns: Namespace,
        module_id: LocalDefId,
    ) -> Result<(ast::Path, Res), ()> {
        let path = if path_str.starts_with("::") {
            ast::Path {
                span,
                segments: iter::once(Ident::with_dummy_span(kw::PathRoot))
                    .chain(path_str.split("::").skip(1).map(Ident::from_str))
                    .map(|i| self.new_ast_path_segment(i))
                    .collect(),
            }
        } else {
            ast::Path {
                span,
                segments: path_str
                    .split("::")
                    .map(Ident::from_str)
                    .map(|i| self.new_ast_path_segment(i))
                    .collect(),
            }
        };
        let module = self.module_map.get(&module_id).copied().unwrap_or(self.graph_root);
        let parent_scope = &ParentScope::module(module);
        let res = self.resolve_ast_path(&path, ns, parent_scope).map_err(|_| ())?;
        Ok((path, res))
    }
pub fn resolve_str_path_error ( & mut self , span : Span , path_str : & str , ns : Namespace , module_id : LocalDefId , ) -> Result < ( ast :: Path , Res ) , ( ) > { let path = if path_str . starts_with ( " " ) { ast :: Path { span , segments : iter :: once ( Ident :: with_dummy_span ( kw :: PathRoot ) ) . chain ( path_str . split ( " " ) . skip ( 1 ) . map ( Ident :: from_str ) ) . map ( | i | self . new_ast_path_segment ( i ) ) . collect ( ) , } } else { ast :: Path { span , segments : path_str . split ( " " ) . map ( Ident :: from_str ) . map ( | i | self . new_ast_path_segment ( i ) ) . collect ( ) , } } ; let module = self . module_map . get ( & module_id ) . copied ( ) . unwrap_or ( self . graph_root ) ; let parent_scope = & ParentScope :: module ( module ) ; let res = self . resolve_ast_path ( & path , ns , parent_scope ) . map_err ( | _ | ( ) ) ? ; Ok ( ( path , res ) ) }
Rustdoc uses this to resolve things in a recoverable way.
Rustdoc uses this to resolve things in a recoverable way .
&mut self
span
Span
path_str
&str
ns
Namespace
module_id
LocalDefId
&mut self
span
Span
path_str
&str
ns
Namespace
module_id
LocalDefId