diff --git a/src/librustdoc/html/static/main.js b/src/librustdoc/html/static/main.js
index 4f8488cca682b0d7679b962de0150b1971829a8f..484021fedc46f946ae8acca10fa30ccd5dceff91 100644
--- a/src/librustdoc/html/static/main.js
+++ b/src/librustdoc/html/static/main.js
@@ -468,6 +468,8 @@
if ($active.length) {
document.location.href = $active.find('a').prop('href');
}
+ } else {
+ $active.removeClass('highlighted');
}
});
}