Skip to content

Commit a5719b0

Browse files
committed
unconditionally generate search.desc files, remove dbg stmt
1 parent 0b636cc commit a5719b0

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/librustdoc/html/render/write_shared.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,12 @@ pub(crate) fn write_shared(
7373
// Write shared runs within a flock; disable thread dispatching of IO temporarily.
7474
let _lock = try_err!(flock::Lock::new(&lock_file, true, true, true), &lock_file);
7575

76+
let SerializedSearchIndex { index, desc } = build_index(&krate, &mut Rc::get_mut(&mut cx.shared).unwrap().cache, tcx);
77+
write_search_desc(cx, &krate, &desc)?; // does not need to be merged; written unconditionally
78+
7679
let crate_name = krate.name(cx.tcx());
7780
let crate_name = crate_name.as_str(); // rand
7881
let crate_name_json = SortedJson::serialize(crate_name); // "rand"
79-
let SerializedSearchIndex { index, desc } = build_index(&krate, &mut Rc::get_mut(&mut cx.shared).unwrap().cache, tcx);
8082
let external_crates = hack_get_external_crate_names(cx)?;
8183
let info = CrateInfo {
8284
src_files_js: PartsAndLocations::<SourcesPart>::get(cx, &crate_name_json)?,
@@ -89,15 +91,14 @@ pub(crate) fn write_shared(
8991

9092
if let Some(parts_out_dir) = &opt.parts_out_dir {
9193
let path = parts_out_dir.0.clone();
92-
write_create_parents(cx, dbg!(path), serde_json::to_string(&info).unwrap())?;
94+
write_create_parents(cx, path, serde_json::to_string(&info).unwrap())?;
9395
}
9496

9597
let mut crates_info = CrateInfo::read(&opt.parts_paths)?;
9698
crates_info.push(info);
9799

98100
if opt.write_rendered_cci {
99101
write_static_files(cx, &opt)?;
100-
write_search_desc(cx, &krate, &desc)?;
101102
if opt.emit.is_empty() || opt.emit.contains(&EmitType::InvocationSpecific) {
102103
if cx.include_sources {
103104
write_rendered_cci::<SourcesPart>(cx, opt.read_rendered_cci, &crates_info)?;

0 commit comments

Comments
 (0)