@@ -37,7 +37,7 @@ type Attrs<'hir> = rustc_middle::ty::Attributes<'hir>;
37
37
/// and `Some` of a vector of items if it was successfully expanded.
38
38
///
39
39
/// `parent_module` refers to the parent of the *re-export*, not the original item.
40
- pub fn try_inline (
40
+ crate fn try_inline (
41
41
cx : & DocContext < ' _ > ,
42
42
parent_module : DefId ,
43
43
res : Res ,
@@ -137,7 +137,7 @@ pub fn try_inline(
137
137
Some ( ret)
138
138
}
139
139
140
- pub fn try_inline_glob (
140
+ crate fn try_inline_glob (
141
141
cx : & DocContext < ' _ > ,
142
142
res : Res ,
143
143
visited : & mut FxHashSet < DefId > ,
@@ -160,15 +160,15 @@ pub fn try_inline_glob(
160
160
}
161
161
}
162
162
163
- pub fn load_attrs < ' hir > ( cx : & DocContext < ' hir > , did : DefId ) -> Attrs < ' hir > {
163
+ crate fn load_attrs < ' hir > ( cx : & DocContext < ' hir > , did : DefId ) -> Attrs < ' hir > {
164
164
cx. tcx . get_attrs ( did)
165
165
}
166
166
167
167
/// Record an external fully qualified name in the external_paths cache.
168
168
///
169
169
/// These names are used later on by HTML rendering to generate things like
170
170
/// source links back to the original item.
171
- pub fn record_extern_fqn ( cx : & DocContext < ' _ > , did : DefId , kind : clean:: TypeKind ) {
171
+ crate fn record_extern_fqn ( cx : & DocContext < ' _ > , did : DefId , kind : clean:: TypeKind ) {
172
172
let crate_name = cx. tcx . crate_name ( did. krate ) . to_string ( ) ;
173
173
174
174
let relative = cx. tcx . def_path ( did) . data . into_iter ( ) . filter_map ( |elem| {
@@ -189,7 +189,7 @@ pub fn record_extern_fqn(cx: &DocContext<'_>, did: DefId, kind: clean::TypeKind)
189
189
}
190
190
}
191
191
192
- pub fn build_external_trait ( cx : & DocContext < ' _ > , did : DefId ) -> clean:: Trait {
192
+ crate fn build_external_trait ( cx : & DocContext < ' _ > , did : DefId ) -> clean:: Trait {
193
193
let trait_items =
194
194
cx. tcx . associated_items ( did) . in_definition_order ( ) . map ( |item| item. clean ( cx) ) . collect ( ) ;
195
195
@@ -284,7 +284,7 @@ fn build_type_alias_type(cx: &DocContext<'_>, did: DefId) -> Option<clean::Type>
284
284
type_. def_id ( ) . and_then ( |did| build_ty ( cx, did) )
285
285
}
286
286
287
- pub fn build_ty ( cx : & DocContext < ' _ > , did : DefId ) -> Option < clean:: Type > {
287
+ crate fn build_ty ( cx : & DocContext < ' _ > , did : DefId ) -> Option < clean:: Type > {
288
288
match cx. tcx . def_kind ( did) {
289
289
DefKind :: Struct | DefKind :: Union | DefKind :: Enum | DefKind :: Const | DefKind :: Static => {
290
290
Some ( cx. tcx . type_of ( did) . clean ( cx) )
@@ -295,7 +295,7 @@ pub fn build_ty(cx: &DocContext<'_>, did: DefId) -> Option<clean::Type> {
295
295
}
296
296
297
297
/// Builds all inherent implementations of an ADT (struct/union/enum) or Trait item/path/reexport.
298
- pub fn build_impls (
298
+ crate fn build_impls (
299
299
cx : & DocContext < ' _ > ,
300
300
parent_module : Option < DefId > ,
301
301
did : DefId ,
@@ -338,7 +338,7 @@ fn merge_attrs(
338
338
}
339
339
340
340
/// Builds a specific implementation of a type. The `did` could be a type method or trait method.
341
- pub fn build_impl (
341
+ crate fn build_impl (
342
342
cx : & DocContext < ' _ > ,
343
343
parent_module : impl Into < Option < DefId > > ,
344
344
did : DefId ,
@@ -527,7 +527,7 @@ fn build_module(cx: &DocContext<'_>, did: DefId, visited: &mut FxHashSet<DefId>)
527
527
}
528
528
}
529
529
530
- pub fn print_inlined_const ( cx : & DocContext < ' _ > , did : DefId ) -> String {
530
+ crate fn print_inlined_const ( cx : & DocContext < ' _ > , did : DefId ) -> String {
531
531
if let Some ( did) = did. as_local ( ) {
532
532
let hir_id = cx. tcx . hir ( ) . local_def_id_to_hir_id ( did) ;
533
533
rustc_hir_pretty:: id_to_string ( & cx. tcx . hir ( ) , hir_id)
@@ -644,7 +644,7 @@ fn separate_supertrait_bounds(
644
644
( g, ty_bounds)
645
645
}
646
646
647
- pub fn record_extern_trait ( cx : & DocContext < ' _ > , did : DefId ) {
647
+ crate fn record_extern_trait ( cx : & DocContext < ' _ > , did : DefId ) {
648
648
if did. is_local ( ) {
649
649
return ;
650
650
}
0 commit comments