diff --git a/src/librustdoc/html/static/main.css b/src/librustdoc/html/static/main.css
index 8d42dd15ef329..f24110a62eb1b 100644
--- a/src/librustdoc/html/static/main.css
+++ b/src/librustdoc/html/static/main.css
@@ -118,7 +118,11 @@ body {
.content h1 { margin-top: 0; }
.content h1, .content h2 { margin-left: -20px; }
.content pre { padding: 20px; }
-
+.content.source pre.rust {
+ white-space: pre;
+ overflow: auto;
+ padding-left: 0;
+}
.content pre.line-numbers { float: left; border: none; }
.line-numbers span { color: #c67e2d; }
.line-numbers .line-highlighted {