@@ -105,15 +105,15 @@ pub fn krate(mut cx: &mut DocContext<'_>) -> Crate {
105105}
106106
107107// extract the stability index for a node from tcx, if possible
108- fn get_stability ( cx : & DocContext < ' _ > , def_id : DefId ) -> Option < Stability > {
108+ pub fn get_stability ( cx : & DocContext < ' _ > , def_id : DefId ) -> Option < Stability > {
109109 cx. tcx . lookup_stability ( def_id) . clean ( cx)
110110}
111111
112- fn get_deprecation ( cx : & DocContext < ' _ > , def_id : DefId ) -> Option < Deprecation > {
112+ pub fn get_deprecation ( cx : & DocContext < ' _ > , def_id : DefId ) -> Option < Deprecation > {
113113 cx. tcx . lookup_deprecation ( def_id) . clean ( cx)
114114}
115115
116- fn external_generic_args (
116+ pub fn external_generic_args (
117117 cx : & DocContext < ' _ > ,
118118 trait_did : Option < DefId > ,
119119 has_self : bool ,
@@ -161,8 +161,8 @@ fn external_generic_args(
161161
162162// trait_did should be set to a trait's DefId if called on a TraitRef, in order to sugar
163163// from Fn<(A, B,), C> to Fn(A, B) -> C
164- fn external_path ( cx : & DocContext < ' _ > , name : Symbol , trait_did : Option < DefId > , has_self : bool ,
165- bindings : Vec < TypeBinding > , substs : SubstsRef < ' _ > ) -> Path {
164+ pub fn external_path ( cx : & DocContext < ' _ > , name : Symbol , trait_did : Option < DefId > , has_self : bool ,
165+ bindings : Vec < TypeBinding > , substs : SubstsRef < ' _ > ) -> Path {
166166 Path {
167167 global : false ,
168168 res : Res :: Err ,
@@ -178,7 +178,7 @@ fn external_path(cx: &DocContext<'_>, name: Symbol, trait_did: Option<DefId>, ha
178178/// i.e. `[T, U]` when you have the following bounds: `T: Display, U: Option<T>` will return
179179/// `[Display, Option]` (we just returns the list of the types, we don't care about the
180180/// wrapped types in here).
181- fn get_real_types (
181+ pub fn get_real_types (
182182 generics : & Generics ,
183183 arg : & Type ,
184184 cx : & DocContext < ' _ > ,
@@ -285,7 +285,7 @@ pub fn get_all_types(
285285 ( all_types. into_iter ( ) . collect ( ) , ret_types)
286286}
287287
288- fn strip_type ( ty : Type ) -> Type {
288+ pub fn strip_type ( ty : Type ) -> Type {
289289 match ty {
290290 Type :: ResolvedPath { path, param_names, did, is_generic } => {
291291 Type :: ResolvedPath { path : strip_path ( & path) , param_names, did, is_generic }
@@ -309,7 +309,7 @@ fn strip_type(ty: Type) -> Type {
309309 }
310310}
311311
312- fn strip_path ( path : & Path ) -> Path {
312+ pub fn strip_path ( path : & Path ) -> Path {
313313 let segments = path. segments . iter ( ) . map ( |s| {
314314 PathSegment {
315315 name : s. name . clone ( ) ,
@@ -327,7 +327,7 @@ fn strip_path(path: &Path) -> Path {
327327 }
328328}
329329
330- fn qpath_to_string ( p : & hir:: QPath ) -> String {
330+ pub fn qpath_to_string ( p : & hir:: QPath ) -> String {
331331 let segments = match * p {
332332 hir:: QPath :: Resolved ( _, ref path) => & path. segments ,
333333 hir:: QPath :: TypeRelative ( _, ref segment) => return segment. ident . to_string ( ) ,
@@ -345,9 +345,9 @@ fn qpath_to_string(p: &hir::QPath) -> String {
345345 s
346346}
347347
348- fn build_deref_target_impls ( cx : & DocContext < ' _ > ,
349- items : & [ Item ] ,
350- ret : & mut Vec < Item > ) {
348+ pub fn build_deref_target_impls ( cx : & DocContext < ' _ > ,
349+ items : & [ Item ] ,
350+ ret : & mut Vec < Item > ) {
351351 use self :: PrimitiveType :: * ;
352352 let tcx = cx. tcx ;
353353
@@ -420,7 +420,7 @@ impl ToSource for syntax_pos::Span {
420420 }
421421}
422422
423- fn name_from_pat ( p : & hir:: Pat ) -> String {
423+ pub fn name_from_pat ( p : & hir:: Pat ) -> String {
424424 use rustc:: hir:: * ;
425425 debug ! ( "trying to get a name from pattern: {:?}" , p) ;
426426
@@ -458,7 +458,7 @@ fn name_from_pat(p: &hir::Pat) -> String {
458458 }
459459}
460460
461- fn print_const ( cx : & DocContext < ' _ > , n : & ty:: Const < ' _ > ) -> String {
461+ pub fn print_const ( cx : & DocContext < ' _ > , n : & ty:: Const < ' _ > ) -> String {
462462 match n. val {
463463 ty:: ConstKind :: Unevaluated ( def_id, _) => {
464464 if let Some ( hir_id) = cx. tcx . hir ( ) . as_local_hir_id ( def_id) {
@@ -483,14 +483,14 @@ fn print_const(cx: &DocContext<'_>, n: &ty::Const<'_>) -> String {
483483 }
484484}
485485
486- fn print_const_expr ( cx : & DocContext < ' _ > , body : hir:: BodyId ) -> String {
486+ pub fn print_const_expr ( cx : & DocContext < ' _ > , body : hir:: BodyId ) -> String {
487487 cx. tcx . hir ( ) . hir_to_pretty_string ( body. hir_id )
488488}
489489
490490/// Given a type Path, resolve it to a Type using the TyCtxt
491- fn resolve_type ( cx : & DocContext < ' _ > ,
492- path : Path ,
493- id : hir:: HirId ) -> Type {
491+ pub fn resolve_type ( cx : & DocContext < ' _ > ,
492+ path : Path ,
493+ id : hir:: HirId ) -> Type {
494494 if id == hir:: DUMMY_HIR_ID {
495495 debug ! ( "resolve_type({:?})" , path) ;
496496 } else {
@@ -564,7 +564,7 @@ pub fn register_res(cx: &DocContext<'_>, res: Res) -> DefId {
564564 did
565565}
566566
567- fn resolve_use_source ( cx : & DocContext < ' _ > , path : Path ) -> ImportSource {
567+ pub fn resolve_use_source ( cx : & DocContext < ' _ > , path : Path ) -> ImportSource {
568568 ImportSource {
569569 did : if path. res . opt_def_id ( ) . is_none ( ) {
570570 None
0 commit comments