-
Notifications
You must be signed in to change notification settings - Fork 13k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of #109919 - fmease:rustdoc-fix-issue-109488, r=notriddle
rustdoc: escape GAT args in more cases Fixes #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.
- Loading branch information
Showing
2 changed files
with
33 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// Make sure that we escape the arguments of the GAT projection even if we fail to compute | ||
// the href of the corresponding trait (in this case it is private). | ||
// Further, test that we also linkify the GAT arguments. | ||
|
||
// @has 'issue_109488/type.A.html' | ||
// @has - '//pre[@class="rust item-decl"]' '<S as Tr>::P<Option<i32>>' | ||
// @has - '//pre[@class="rust item-decl"]//a[@class="enum"]/@href' '{{channel}}/core/option/enum.Option.html' | ||
pub type A = <S as Tr>::P<Option<i32>>; | ||
|
||
/*private*/ trait Tr { | ||
type P<T>; | ||
} | ||
|
||
pub struct S; | ||
|
||
impl Tr for S { | ||
type P<T> = (); | ||
} |