You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I click on the [src] link of a function in the rendered documentation, if the function's line number is greater than 50000, the browser navigates to line 50000 instead of the proper location. I found the relevant code here:
Interestingly, it looks like if this limit were removed, the for loop here might be a problem. Then, maybe, someone could link to a url such as https://doc.rust-lang.org/src/.../something.rs.html#1-9007199254740992 which would make the page freeze up, since the loop won't exit early if the line doesn't exist. I don't know if this would be considered harmful, however.
The edit would simply be to change the line to to = parseInt(match[2] || match[1], 10);, obviously
…r=Manishearth
Fix lines highlighting in rustdoc source view
Fixes#60948.
This PR fixes how we handle the lines highlighting from the URL (so in "/doc/src/alloc/string.rs.html#285-283", the "285-283" part). We got a hard limit on 50000, for some unknown and lost reasons which was used in case only one line is selected.
r? @Manishearth
When I click on the
[src]
link of a function in the rendered documentation, if the function's line number is greater than 50000, the browser navigates to line 50000 instead of the proper location. I found the relevant code here:rust/src/librustdoc/html/static/main.js
Line 165 in 3418d2f
What's the rationale behind this limitation? Can it be lifted?
The text was updated successfully, but these errors were encountered: