fix wrong target-redifect links in topbar release list partial #2933
+31
−65
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
So, I think this is the fix for #2922.
Initially thought this has to be an issue with our search-fallback logic (
web::rustdoc::path_for_version
).But then I found our that the version redirect links are generated wrong.
We have this page in the issue:
https://docs.rs/toml/0.5.11/src/toml/de.rs.html
. The expected version-links in the topbar should behttps://docs.rs/crate/toml/0.9.6/target-redirect/x86_64-unknown-linux-gnu/src/toml/de.rs.html
, but they arehttps://docs.rs/crate/toml/0.9.6/target-redirect/x86_64-unknown-linux-gnu/toml/toml/de.rs.html
.See the difference?
Generally this seems to be a regression from one of #2355, #2113 or something else.
Looking deeper I found an oddness, but not yet how that happened to me:
There is only one place where the
/menus/releases/
partial is loaded, which is the topbar. And there it's only loaded when we have docs. So, if I'm not missing something, there is no place where the partial is loaded without target or without inner-path. So IMO quite a bit of the complexity inget_all_releases
can be removed.The changed tests are for things I believe that also can't happen in prod.
Or am I missing something?