Skip to content

Rustdoc does not escape GAT arguments when it fails to compute the href link for the trait #109488

Closed
@fmease

Description

@fmease

Given

pub type A = <S as Tr>::P<Option<i32>>; // `i32` instead of `Option<i32>` would work too but it's not as pronounced

pub struct S;
/*priv*/ trait Tr { type P<T>; }
impl Tr for S { type P<T> = (); }

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:

pub type A = <S as Tr>::P>; 

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

Metadata

Metadata

Assignees

Labels

A-GATsArea: Generic associated types (GATs)A-rustdoc-uiArea: Rustdoc UI (generated HTML)C-bugCategory: This is a bug.F-generic_associated_types`#![feature(generic_associated_types)]` a.k.a. GATsT-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions