-
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
Struct.field should resolve for intra-doc-links #75437
Comments
Relevant code:
We're treating enum variants and struct fields the same. |
I'm actually kinda iffy on this, I prefer the current behavior and we get to avoid clashes with |
Hmm, I think |
Yeah I'm just worried about the possibilities of ambiguity. It was listed as an optional extension in the rfc and iirc this was part of why. |
I'm not a big fan of this syntax but it's not a strong position either... |
|
@camelid the concern I think is that there's no way to detect the ambiguity without reaching out and making network requests, which no one wants. So there's the potential that rustdoc could silently link to something other than what you intended, which is against the spirit of intra-doc links. |
and as a corrollary, rustdoc couldn't warn if the link failed to resolve, because it would have to assume it was a network link. |
Yeah, it's too bad that there's not a solution that doesn't involve ambiguity and isn't surprising :( |
I think changes in this area should be a change to the intra-doc links RFC, not an implementation issue, so I'm going to close this. |
Found in #75432 (review).
std::process::Child.stdout
should resolve to the struct field, but instead gives a resolution error - you have to useChild::stdout
instead. This is a break from the original RFC: https://github.com/rust-lang/rfcs/blob/68e17ace829e81239fe5020b7a6dbc22550b6d16/text/1946-intra-rustdoc-links.md#linking-to-fieldsThe text was updated successfully, but these errors were encountered: