-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Anchor names for some impls are not predictable #71912
Comments
cc @rust-lang/rustdoc |
As a workaround, I added |
Similar, if you have multiple |
IMO the links rustdoc generates are not and should not be stable. The fix is to use intra-doc links (#43466), which unfortunately are not yet stable (but should be stabilized in the next release: #74430). But I don't think we should change the anchors to be predictable, people shouldn't be depending on them in the first place. |
@jyn514 hard to do that across crates. |
If it's a crate that is not one of your dependencies, it's not possible, indeed. |
If it's not one of your dependencies (and in particular not your crate), then you can't depend on the anchor being present, you have to first navigate to it and be sure it's there before hard-coding it. So I don't think that's an argument to make the anchor predictable, just that doc authors should verify their links are present. |
I personally think that the generated HTML shouldn't be generated, I was just stating a fact. ;) |
Another difficulty is linking usefully to docs from (for example) an mdbook. |
I have a struct with a generic type:
Then I have implementations for different concrete types, e.g.,:
I want to link to the documentation for one of those implementations. But their anchors are called "#method.revocation_status-1", "#method.revocation_status-2", etc., which is brittle. It would be nice if the anchor names were more predictable.
The text was updated successfully, but these errors were encountered: