Skip to content

Commit e218380

Browse files
committed
Make some functions private that don't have to be public
1 parent 500ddc5 commit e218380

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/librustdoc/clean/inline.rs

+10-10
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ type Attrs<'hir> = rustc_middle::ty::Attributes<'hir>;
3737
/// and `Some` of a vector of items if it was successfully expanded.
3838
///
3939
/// `parent_module` refers to the parent of the *re-export*, not the original item.
40-
pub fn try_inline(
40+
crate fn try_inline(
4141
cx: &DocContext<'_>,
4242
parent_module: DefId,
4343
res: Res,
@@ -137,7 +137,7 @@ pub fn try_inline(
137137
Some(ret)
138138
}
139139

140-
pub fn try_inline_glob(
140+
crate fn try_inline_glob(
141141
cx: &DocContext<'_>,
142142
res: Res,
143143
visited: &mut FxHashSet<DefId>,
@@ -160,15 +160,15 @@ pub fn try_inline_glob(
160160
}
161161
}
162162

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> {
164164
cx.tcx.get_attrs(did)
165165
}
166166

167167
/// Record an external fully qualified name in the external_paths cache.
168168
///
169169
/// These names are used later on by HTML rendering to generate things like
170170
/// 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) {
172172
let crate_name = cx.tcx.crate_name(did.krate).to_string();
173173

174174
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)
189189
}
190190
}
191191

192-
pub fn build_external_trait(cx: &DocContext<'_>, did: DefId) -> clean::Trait {
192+
crate fn build_external_trait(cx: &DocContext<'_>, did: DefId) -> clean::Trait {
193193
let trait_items =
194194
cx.tcx.associated_items(did).in_definition_order().map(|item| item.clean(cx)).collect();
195195

@@ -284,7 +284,7 @@ fn build_type_alias_type(cx: &DocContext<'_>, did: DefId) -> Option<clean::Type>
284284
type_.def_id().and_then(|did| build_ty(cx, did))
285285
}
286286

287-
pub fn build_ty(cx: &DocContext<'_>, did: DefId) -> Option<clean::Type> {
287+
crate fn build_ty(cx: &DocContext<'_>, did: DefId) -> Option<clean::Type> {
288288
match cx.tcx.def_kind(did) {
289289
DefKind::Struct | DefKind::Union | DefKind::Enum | DefKind::Const | DefKind::Static => {
290290
Some(cx.tcx.type_of(did).clean(cx))
@@ -295,7 +295,7 @@ pub fn build_ty(cx: &DocContext<'_>, did: DefId) -> Option<clean::Type> {
295295
}
296296

297297
/// 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(
299299
cx: &DocContext<'_>,
300300
parent_module: Option<DefId>,
301301
did: DefId,
@@ -338,7 +338,7 @@ fn merge_attrs(
338338
}
339339

340340
/// 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(
342342
cx: &DocContext<'_>,
343343
parent_module: impl Into<Option<DefId>>,
344344
did: DefId,
@@ -527,7 +527,7 @@ fn build_module(cx: &DocContext<'_>, did: DefId, visited: &mut FxHashSet<DefId>)
527527
}
528528
}
529529

530-
pub fn print_inlined_const(cx: &DocContext<'_>, did: DefId) -> String {
530+
crate fn print_inlined_const(cx: &DocContext<'_>, did: DefId) -> String {
531531
if let Some(did) = did.as_local() {
532532
let hir_id = cx.tcx.hir().local_def_id_to_hir_id(did);
533533
rustc_hir_pretty::id_to_string(&cx.tcx.hir(), hir_id)
@@ -644,7 +644,7 @@ fn separate_supertrait_bounds(
644644
(g, ty_bounds)
645645
}
646646

647-
pub fn record_extern_trait(cx: &DocContext<'_>, did: DefId) {
647+
crate fn record_extern_trait(cx: &DocContext<'_>, did: DefId) {
648648
if did.is_local() {
649649
return;
650650
}

0 commit comments

Comments
 (0)