diff --git a/src/librustdoc/html/static/main.js b/src/librustdoc/html/static/main.js
index 1b3eb2011afdc..67e50bba1f2e0 100644
--- a/src/librustdoc/html/static/main.js
+++ b/src/librustdoc/html/static/main.js
@@ -2716,10 +2716,6 @@ function defocusSearchBar() {
};
}
- window.onresize = function() {
- hideSidebar();
- };
-
if (main) {
onEachLazy(main.getElementsByClassName("loading-content"), function(e) {
e.remove();