-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Allow generic parameters in intra doc link #62834
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
In relation to the objection @GuillaumeGomez had on the tracking thread, I have a usecase where I want to link to the different parts of a fully applied (nested) generic type. Extending the example slightly, should the following also work: pub struct Collection<T> { __: T }
pub struct U;
/// [`Collection`], [`Collection<T>`], [`Collection<U>`]
pub struct S; and should that result in something like: ? |
Would it make sense to support entire specialized doc pages like ".../target/doc/general/struct.General<i32>.html" (exact URL can't look like this I believe) so a link to a specific type of a polymorphic type can filter out all other This might be nice in some specific use cases that make heavy use of specialized implementations. |
That seems a much bigger change than the one originally suggested. For one thing we'd have to design what the page should look like. I wonder if we could hack this by deleting all text between |
I've also seen people trying to use |
I'm still strongly against it. However, I don't remember if we can mix type and anchor? Like: EDIT: It's already supported. I'll add it to the documentation of intra-doc links. |
Direct link so all the discussion is in one place: #43466 (comment) |
Well, it's still possible to link to |
Is a simple version of this planned to be implemented? A nice start would be something where Here's a link to [`Vec<T>`].
[`Vec<T>`]: Vec |
Mentoring instructions: Just before calling |
I would be interested in implementing this. @rustbot claim |
Currently this renders as ` Collection, [
Collection<T>
] `, where the first link is ok but the second link is not rendered. I think these should both point to struct.Collection.html. For some types it can be clearer to include the type parameters when discussing them.Mentioning the tracking issue: #43466
The text was updated successfully, but these errors were encountered: