Skip to content

Commit 51c35db

Browse files
author
Joshua Holmer
committed
Fix unpredictable ordering of sidebar boxes in rustdoc
A race condition in Javascript was causing unpredictable ordering of the sidebar boxes when loading documentation generated by rustdoc, due to the script that adds the Crates box being executed asynchronously. Disabling the asynchronous execution and deferring this script should ensure that the Crates box always appears last in the sidebox (this seemed to be the more common ordering prior to this change). Fixes #29698
1 parent 28f6b88 commit 51c35db

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/librustdoc/html/layout.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ r##"<!DOCTYPE html>
137137
<script src="{root_path}jquery.js"></script>
138138
<script src="{root_path}main.js"></script>
139139
{play_js}
140-
<script async src="{root_path}search-index.js"></script>
140+
<script defer src="{root_path}search-index.js"></script>
141141
</body>
142142
</html>"##,
143143
content = *t,

0 commit comments

Comments
 (0)