-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Rustdoc does not escape GAT arguments when it fails to compute the href link for the trait #109488
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Copying my comment from #109246: rust/src/librustdoc/html/format.rs Line 1158 in 4c0f500
|
Here's a live example: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_trait_selection/infer/trait.ObligationEmittingRelation.html#tymethod.register_predicates As it turns out, this bug does appear to be what's crashing rustdoc in #109246. So I will wind up fixing it. But feel free to investigate and fix if you prefer not to wait. |
This wound up being the fix: 236c18f |
On
Thanks for the live example! |
…=notriddle rustdoc: escape GAT args in more cases Fixes rust-lang#109488. Previously we printed the *un*escaped form of GAT arguments not only when `f.alternate()` was true but *also* when we failed to compute the URL of the trait associated with the type projection, i.e. when `href(…)` returned an `Err(_)`. In this PR the argument printing logic is entirely separate from the above link resolution code as it should be. Further, we now only try to compute the URL if the HTML format was requested with `!f.alternate()`. Before, we would sometimes compute the `href` only to throw it away later.
Uh oh!
There was an error while loading. Please reload this page.
Given
Rustdoc does not escape the ASCII angle brackets for the generic argument list of the generic associated type projection
<S as Tr>::P
leading to the following butchered HTML output:I've noticed this while working on rustdoc integration for
AliasKind::Inherent
in #109410. It's possible that the refactoring PR #109246 will fix this (need to check) or at least make it more pleasant to fix. Assigning myself for now since I'm gonna fix this otherwise.@rustbot claim
@rustbot label T-rustdoc A-rustdoc-ui F-generic_associated_types
The text was updated successfully, but these errors were encountered: