about summary refs log tree commit diff
path: root/src/librustdoc/html/static/js/source-script.js
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-05-31 01:17:00 +0000
committerbors <bors@rust-lang.org>2022-05-31 01:17:00 +0000
commit47365c0d656e2e55d1b6b9dad92842540e3ed1af (patch)
treed894135259174abd7972b44c9b07ed8118b522f6 /src/librustdoc/html/static/js/source-script.js
parent7be9ec27652f2c3b820d341158b0e005f42e248e (diff)
parentb3dc31ca9ce37a586b0d73a737aa9841671fd7c1 (diff)
downloadrust-47365c0d656e2e55d1b6b9dad92842540e3ed1af.tar.gz
rust-47365c0d656e2e55d1b6b9dad92842540e3ed1af.zip
Auto merge of #97566 - compiler-errors:rollup-qfxw4j8, r=compiler-errors
Rollup of 6 pull requests

Successful merges:

 - #89685 (refactor: VecDeques Iter fields to private)
 - #97172 (Optimize the diagnostic generation for `extern unsafe`)
 - #97395 (Miri call ABI check: ensure type size+align stay the same)
 - #97431 (don't do `Sized` and other return type checks on RPIT's real type)
 - #97555 (Source code page: line number click adds `NaN`)
 - #97558 (Fix typos in comment)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'src/librustdoc/html/static/js/source-script.js')
-rw-r--r--src/librustdoc/html/static/js/source-script.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/librustdoc/html/static/js/source-script.js b/src/librustdoc/html/static/js/source-script.js
index aaac878d3a3..58c036e0b3c 100644
--- a/src/librustdoc/html/static/js/source-script.js
+++ b/src/librustdoc/html/static/js/source-script.js
@@ -205,6 +205,10 @@ const handleSourceHighlight = (function() {
 
     return ev => {
         let cur_line_id = parseInt(ev.target.id, 10);
+        // It can happen when clicking not on a line number span.
+        if (isNaN(cur_line_id)) {
+            return;
+        }
         ev.preventDefault();
 
         if (ev.shiftKey && prev_line_id) {